XML Sitemap Best Practices: The 2026 SEO Guide
Last Updated: September 9, 2026
If Google is slow to find your new content, or you’ve never actually looked at what’s inside your sitemap file, this guide covers what actually matters in 2026: what a sitemap does, how to build one correctly, and when you need the image, video, or index-file variants. It builds on the indexability fundamentals covered in our technical SEO guide — a sitemap only helps once the pages inside it are genuinely crawlable and indexable in the first place.
An XML sitemap is a file which contains all of the canonical, indexable URL‘s on a website to facilitate easy discovery and crawling of every page by search engines.
What an XML sitemap actually does
Sitemap, which is just a discovery aid, not a ranking factor. Submitting a sitemap doesn‘t mean Google will crawl or index anything, and it doesn‘t directly affect the position of a page after it has been indexed, what it does is it provides the search engines with a direct comprehensive list of the URLs that you want them to find rather than having to rely entirely on good old-fashioned crawling – which is most important for large, poorly internally-linked sites or sites that produce content so quickly that it would not be uncovered otherwise.
The flip side is equally important: if you have a sitemap stuffed with non-canonical duplicates, redirects, 404s or thin pages, all of these are not only providing minimal value, but actively contributing to the lost attention that your good pages are fighting for. A poorly-maintained sitemap is also a subtle red flag to crawlers that the rest of the site may not be well looked after. Every good website should see their sitemap as a carefully filtered-out collection of your best URLs.
How to create a sitemap

For nearly all sites the sitemap should be dynamically generated rather than kept manually. A static, manually-edited XML file is only defensible for a genuinely unchanging small site — a single landing page or a portfolio with no blog — and even then it’s easy to let it go stale.
To build one correctly:
- Include only canonical, indexable URLs returning a 200 status. No redirects, no 404s, no noindexed pages, no parameter-based duplicates. Every junk URL in the file wastes trust and crawl attention.
- Use fully-qualified, absolute URLs, not relative paths.
- Keep
lastmoddates honest. Google uses this field, but only when it’s accurate — updating the date without a real content change gets ignored over time. - Skip
priorityandchangefreqentirely, or leave them at default. Google has also confirmed that both fields are ignored by the search engine in its crawling and ranking processes, mainly as they were so abused by most every webmasters setting all pages to priority 1.0 that the signal has lost all relevance. - Host the file in your domain root so it covers the whole website and add the following in the robots.txt.
- Submit it to Google Search Console and have your CMS or plugin regenerate it in a similar fashion when the content updates so that a new page loads in the file, say, in a matter of minutes rather than waiting until you update it manually.
Sitemap generator options

The right tool depends on your platform and site size, not a single universal answer.
- WordPress: Yoast SEO and Rank Math will generate & update automatically xml sitemaps as default. In case your website requires media sitemaps, take into consideration that video and image is available in the free rank Math version if you use Rank Math, but the only available in paid Premium plan in Yoast.
- Other CMS/frameworks: Several of the existing CMSs and static-site generators (Next.js, Astro, Hugo) have a sitemap generator built-in. Use the default sitemap generator your platform offers before falling back to a third-party option.
- Large or complex sites needing an audit-first approach: Screaming Frog crawls your actual site and lets you build a sitemap from real crawl data, excluding thin content, redirects, and non-canonical URLs before anything is written to the file — a meaningfully different (and more accurate) approach than tools that just query your CMS database directly.
- Quick one-off generation: Browser-based tools like XML-Sitemaps.com work for a fast, no-installation sitemap on a small site, but they don’t auto-update — fine for a one-time need, not a long-term solution.
Whatever tool you use, treat Search Console as your submission and monitoring point, not your generation tool — it validates and reports on a sitemap, but the file itself has to come from your CMS, framework, or crawler.
Image sitemap

Image sitemap – An image sitemap adds <image: image> tags inside each <url> element of your usual XML sitemap, indicating to Google which images on a page to index for the image search. It is not a new file-by adding image sitemap information to your existing site map, you don‘t need a new file.
This is worth building when image search is a meaningful traffic channel for your site: e-commerce product photography, recipe or DIY content, stock photography, or any visually-driven catalog. It’s not worth the maintenance overhead for a mostly text-based blog where images are purely decorative.
The core requirement is straightforward: each <image:loc> tag needs an absolute URL to the image file, nested under the page URL where that image actually appears. You can include multiple images per page (up to 1,000 per URL), but there’s no benefit to listing every decorative icon or UI element — reserve it for images that are genuinely worth someone finding through image search.
Video sitemap
The video sitemap is a separate XML file (not an extension of your main sitemap) where you add structured data about the video on a page (the page URL, a thumbnail, a title, a description and either a URL to the video file itself, or a URL to a video player)
The detail most guides skip: Google is not going to index the video if the page is on, unless the video is the main thing on that page (and the sitemap entry is spot-on). So a two-minute demo video on a blog post 1 ½ hours of blogging isn‘t likely to be considered a primary thing. If video visibility actually matters to your site, the practical fix is building a dedicated “watch” page per video — with the video as the clear primary content — and linking to it from any blog posts that reference it, rather than expecting embedded videos deep in article pages to get indexed as video results.
After created, put it to a clear location (often /video-sitemap.xml) and submit it separately through Search Console. Video Indexing Report in Index category shows video-specific errors, and “not the main content” rejection is the most frequent rejection type.
Sitemap index file

A sitemap index file is simply a file that lists other sitemap files — it doesn’t contain URLs itself. You need one once a single sitemap would go over 50,000 URLs or 50MB uncompressed. This is a strict limit that has been explicitly confirmed both in Google‘s own developer docs and in the sitemaps.org protocol followed by Google and other search engines.
The practical decision point: if your site has less than ~40000-45000 (rough guidline) indexable URLs overall, one sitemap file is okay, and an index file adds complication without gain. If you‘re starting to nibble at that limits, or you want to subdivide sitemaps by content type for monitoring (products, blog-posts, categories, each as their own file), do it in prep rather than for want of a place to put the new urls.
A sitemap index file also has a set limit an index can only include up to 50,000 individual sitemaps in itself more than sufficient for any non-giant enterprise directory. Submit that one index file to Search Console, and not each sub-sitemap individually. However, if you want to track the indexing behavior of child sitemaps within that index separately, that‘s also a feature available to you.
FAQ
Do I need an XML sitemap for SEO?
Not always but it usually costs little and returns benefit. Small site with deep site architecture where each page is can be reached within two three clicks from the homepage may not gain much from providing search engines with a direct list of URLs. Larger websites, websites lacking in depth of internal links and those which are commonly updated with fresh content, stand to gain hugely from giving search engines a clear hierarchical list of the URLs on their site.
What’s the difference between an XML sitemap and an HTML sitemap?
An XML sitemap is used for search engine spiders. It is a list of URLs, in a structured machine readable way. An HTML sitemap is just a conventional web page listing links in a way as to help humans navigate around the website. It is not used by search engine crawlers to detect the structure of the site. Most websites should have an XML sitemap and if the site is very large or complex then an HTML sitemap is necessary.
How many URLs can be in one sitemap?
A single sitemap file can contain a maximum of 50,000 URLs or 50MB of uncompressed data, whichever is greater. Files exceeding either limit will be truncated, with Google essentially ignoring everything that comes after that point. To be indexed by Google, sites with more than 50,000 pages will need to break their sitemaps into sets of less than 50,000 pages link to a sitemap index file.
Does the priority tag in a sitemap affect rankings?
No. Google has said it disregards both the < priority > and < changefreq > tags for crawling and ranking purposes. They are present in the sitemap protocol but in practice became useless when after every page was assigned the maximum priority there‘s really no incentive to spend too much time getting them right.
How do I submit a sitemap to Google?
Submit the sitemap‘s complete URL by navigating to Search Traffic section of Google Search Console and then choose Sitemaps option, where you should add the complete address of the sitemap or directly in your robots.txt file by using a Sitemap: line. The submission through Search Console is the safer one as it also provides indexing status and error report for the URLs inside the file.
Creative marketing enthusiast sharing practical insights on digital growth, branding, and online strategies. Passionate about helping businesses succeed with simple, effective, and result-driven marketing solutions.