Skip to content
Advertisement

How to generate a sitemap.xml using laravel-sitemap without images url?

I am using spatie to generate sitemap.xml. It is working properly as it is expected. But as per some requirement I would like to not include any image url in sitemap.xml.

This is my code –

JavaScript

Currently my sitemap.xml something looks like this with image links –

JavaScript

This there any way to remove those image links from sitemap.xml?

Appreciate for help.

Advertisement

Answer

Please follow this part of document – spatie. This is not specifically omit images but if there is any specific format in your url for images link – http://www.example.com/uploads then try to get segment(1) and compare so this part of documentation will work.

In your case as an example –

JavaScript

Hope this will work for you.

User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement