Why is sitemap-0.xml generated for small sites?
See original GitHub issueDescribe the bug
When I first installed this package, it generated sitemap.xml
. Earlier this year, my site started generating a sitemap-0.xml
file. It’s a small site of <20 URLs so no need for multiple sitemaps.
Is this a bug I introduced or a feature of this package? I read https://github.com/iamvishnusankar/next-sitemap/issues/318 but it didn’t help much because I really just want sitemap.xml
only.
My package.json:
{
"build": "next build",
"postbuild": "next-sitemap"
"devDependencies": {
....
"next-sitemap": "^2.5.14",
}
}
My next-sitemap.js
module.exports = {
siteUrl: "example.com",
generateRobotsTxt: true,
changefreq: "daily",
priority: 0.7,
exclude: [ ... ],
};
To Reproduce
npm run build
Expected behavior
Since I have a small site, I expect to have only sitemap.xml
file. No need for split sitemap files.
Issue Analytics
- State:
- Created a year ago
- Comments:14 (4 by maintainers)
Top Results From Across the Web
Google: Small Sites Don't Need XML Sitemaps
Google Sitemap It is almost unheard of to build a new web site and not launch with a basic XML Sitemap for better...
Read more >Is it necessary/useful to build a sitemap for a small website?
The xml sitemap you should definatley have and add to Google Webmaster tools in an effort to get the site fully indexed. The...
Read more >XML Sitemaps Are Overrated. Do You Really Need Them?
XML sitemaps are effective and necessary SEO tools for very large sites. But if you're a small to medium-sized site with good internal...
Read more >How to Optimize XML Sitemaps: 13 SEO Best Practices
1. Use Tools & Plugins to Generate Your Sitemap Automatically · 2. Submit Your Sitemap to Google · 3. Prioritize High-Quality Pages in...
Read more >Sitemaps and Sitemap Generators Explained Simply
XML sitemaps are essentially a list of URLs so that a search engine can easily know which pages you want them to crawl...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I second this. I have a small site and expected a simple
sitemap.xml
.Generating a sitemap index that links to the actual sitemap is just… weird. It forced me spend time re-reading the docs to make sure something is not wrong with my config. I concluded it’s probably fine and submitted my code. But then other team members though it was weird too, so I had to spend more time on Google, learning how sitemap indexes work and making sure that having an index instead of a single sitemap is not somehow worse for SEO.
It also breaks some sitemap validation tools that are like “Paste the URL of your site here… Sitemap is valid!”. But it only validates the sitemap index, not the actual sitemap. Like, I understand that going for an index every time probably streamlines the code, but it goes against user expectation. It would be more intuitive if the output was just a single sitemap.xml for small sites (maybe make the limit configurable). Thanks for your consideration! 😃
@benjaminhoffman, @JuroUhlar, @CloutProject, @dkodeit, @FitFingers, @isaachinman
Refactored the entire project and added support for disabling index-sitemap generation along with ESM support.