hello i would like to remove the 0 priority assigned to the tags/categories on my stitemap https://www.tahmil.me/sitemap.xml how i can do that
- Why? Technically speaking that is correct, because tag-indexes should have no priority and 0 is “no”.
- Do you have a sitemap layout or is your site using the internal sitemap layout? If you use the internal sitemap then add
/content/tags/tagname/index.md
with the following frontmatter (untested):
sitemap:
changefreq: monthly
priority: 0.5
If your theme is NOT using the internal layout you need to check your sitemap layout and find out, where the priority is parsed from.
Hi thank’s for the solution.
why i want to remove the priority; because my tags are not getting indexed by google 97% of them are being excluded, on the other hand i have another website and the sitemap doesn not have any priority assigned and the indexing id going very well
ps; i use the internal sitemap layout does the /tagname means i have to add all my tags on that tags folder i use allot of tags is there an automatic why to do that i can’t add them all manually
I am honestly not sure if that is the full solution. Looking at the internal sitemap layout I would expect your sitemap to show priority in ALL items, not just tags.
Make sure that your theme is not having it’s own sitemap template. Without you posting your public repo (can be a stripped down version) we can’t find out much.
sorry i totally forgot to share my repo here it is : https://github.com/SamHamou/Feed
if you want to change sitemap priority from the front-matter for an entire section you can use cascade
https://gohugo.io/content-management/front-matter/#front-matter-cascade
So you’d set your cascade on ./content/tags/_index.md
and/or ./content/categories/_index.md
, and it’ll cascade down to everything below it.
Note as @davidsneighbour says this won’t REMOVE the <priority>
tag, but you can selectively set it to whatever number you want.