- Aug 1, 2024
- 168
- 67
What are the best practices for XML sitemaps?
I would say 1k URLs per xml sitemapKeep it under 50k URLs or 50MB per file split into multiple if needed.
Good points. The official spec allows up to 50k URLs or 50MB per file, but in practice smaller sitemaps like 1k URLs each are easier to manage and ensure faster processing. As long as you keep them clean, regularly updated, and submitted in Search Console, both approaches work fine.I would say 1k URLs per xml sitemap
a few years ago it was said that google would only read the first few thousand links of xml sitemaps, so 1k urls is a good target
you can write a php/python code to do that for you. Pretty easily doneGood points. The official spec allows up to 50k URLs or 50MB per file, but in practice smaller sitemaps like 1k URLs each are easier to manage and ensure faster processing. As long as you keep them clean, regularly updated, and submitted in Search Console, both approaches work fine.
That makes sense, thanks! Splitting into smaller sitemaps definitely seems easier to manage. I hadn’t thought about automating it with a simple PHP/Python script I’ll look into that. Do you have any preferred approach or script example you’ve used?you can write a php/python code to do that for you. Pretty easily done
Here are the best practices for XML sitemaps (straight to the point):What are the best practices for XML sitemaps?
Thanks a lot for sharing these concise sitemap best practices—super clear and to the point, really helpful for keeping things optimized!Here are the best practices for XML sitemaps (straight to the point):
- Include only indexable URLs – Don’t list nonindexed, redirected, or duplicate pages.
- Keep it clean & updated – Add new pages and remove deleted ones regularly.
- Stay within limits – Max 50,000 URLs or 50 MB per sitemap; use a sitemap index if needed.
- Use correct tags – <loc>, <lastmod>, <changefreq>, <priority> (optional, but <loc> and <lastmod> are most useful).
- Canonical URLs only – Ensure the listed URLs match your preferred canonical version.
- Submit to Google & Bing – Through Google Search Console and Bing Webmaster Tools.
- Place sitemap in root – e.g., example.com/sitemap.xml for sitewide coverage.
- Use HTTPS – Only list secure URLs if your site uses HTTPS.
- Separate by type if large – e.g., one sitemap for blog posts, another for products, etc.
- Compress if needed – Use .gz if the file is very large.
I think you can even submit xml sitemaps through api so its automated 100%That makes sense, thanks! Splitting into smaller sitemaps definitely seems easier to manage. I hadn’t thought about automating it with a simple PHP/Python script I’ll look into that. Do you have any preferred approach or script example you’ve used?
Would appreciate any pointers if you’ve tried one that works well.