A sitemap is a file or page that lists the URLs on your website, helping search engines discover and understand your site's structure. There are two main types: XML sitemaps (designed for search engine crawlers) and HTML sitemaps (designed for human visitors). Both serve as guides that tell search engines and users what content exists on your site and how it is organised. This guide explains what sitemaps are, whether you need one, and how to create and submit your XML sitemap to Google.
XML vs. HTML Sitemaps
The two types of sitemaps serve different purposes and audiences:
XML sitemaps are structured files in XML format designed specifically for search engine crawlers. They list your site's URLs along with optional metadata — when the page was last modified, how frequently it changes, and its priority relative to other pages on the site. XML sitemaps are submitted to search engines via Google Search Console and Bing Webmaster Tools.
A basic XML sitemap entry looks like this:
<url> <loc>https://example.com/blog/seo-guide</loc> <lastmod>2026-04-01</lastmod> <changefreq>monthly</changefreq> <priority>0.8</priority> </url>
HTML sitemaps are standard web pages listing links to sections and pages of your site, designed for human visitors who are having trouble navigating your site. HTML sitemaps are less critical for large sites with good navigation, but can help with accessibility and internal linking. They are not submitted to search engines and do not serve the same function as XML sitemaps for SEO.
Do You Need a Sitemap?
Google's own guidance states that not every site needs a sitemap. Google can discover pages through links alone — if every page on your site is reachable by following links from your homepage, Googlebot will find them during a standard crawl.
However, a sitemap is beneficial and recommended if:
- Your site is large — sites with hundreds or thousands of pages benefit from a sitemap because even thorough crawling can miss pages that are several clicks from the homepage, or pages added or updated recently that may not yet have internal links.
- Your site is new — new sites have few or no external backlinks, meaning there are limited ways for Googlebot to discover pages except via sitemaps or direct submission. A sitemap accelerates initial indexation.
- Your site has pages that are not well-linked internally — pages that are isolated (not linked from other pages) will not be discovered by crawling alone. Including them in a sitemap provides a discovery route.
- You have recently published important new content — submitting an updated sitemap signals to Google that new content is available for crawling, potentially speeding up indexation.
- Your site uses rich media (images, video) — image sitemaps and video sitemaps (extensions of XML sitemaps) help Google discover and index media content that might otherwise be missed.
For small sites (under 50 pages) with good internal linking and some existing backlinks, a sitemap is less critical — though still harmless and easy to create. For all other sites, a sitemap is a best practice worth implementing.
What to Include in Your XML Sitemap
Include in your sitemap:
- All canonical, indexable pages you want Google to index — blog posts, product pages, service pages, key landing pages
- Pages that are part of your site's primary navigation
- New or recently updated pages you want crawled promptly
Do not include in your sitemap:
- Pages with a
noindexmeta tag — including noindex pages in your sitemap sends conflicting signals to Google - Redirect URLs — include only the final destination URL, not the redirecting URL
- Duplicate content pages that have canonical tags pointing elsewhere — include only the canonical URL
- Pages returning 4xx or 5xx error codes — only include live, accessible pages
- Low-value pages: thank-you pages, login/logout pages, filter/sort URLs generating duplicate listings
A clean, accurate sitemap that lists only valid, indexable canonical URLs is more useful to Google than a comprehensive list that includes many non-indexable pages.
How to Create an XML Sitemap
How you create a sitemap depends on your platform:
WordPress — most SEO plugins generate and maintain XML sitemaps automatically. Yoast SEO, Rank Math, and All in One SEO all include sitemap functionality. Once the plugin is active, your sitemap is typically available at yourdomain.com/sitemap.xml or yourdomain.com/sitemap_index.xml. No manual creation is needed.
Shopify — Shopify automatically generates a sitemap at yourdomain.com/sitemap.xml covering products, collections, blog posts, and pages. No configuration required.
Squarespace — automatically generates a sitemap at yourdomain.com/sitemap.xml.
Laravel / custom frameworks — either use a package (e.g., spatie/laravel-sitemap) to generate sitemaps dynamically, or write a sitemap generation command that outputs an XML file to your public directory. For this site, the sitemap should include all published blog posts, key tool pages, and static pages.
Static sites — tools like Screaming Frog (free up to 500 URLs) can crawl your site and export an XML sitemap. Online generators like XML-Sitemaps.com can crawl small sites and produce a downloadable sitemap file.
Once created, place your sitemap at the root of your domain (yourdomain.com/sitemap.xml) and reference it in your robots.txt file with the line: Sitemap: https://yourdomain.com/sitemap.xml
How to Submit Your Sitemap to Google
Submitting your sitemap to Google Search Console ensures Google knows where to find it and monitors its status:
- Log in to Google Search Console for your property.
- In the left sidebar, go to Indexing — Sitemaps.
- In the "Add a new sitemap" field, enter your sitemap URL (e.g.,
sitemap.xml) and click Submit. - Search Console will attempt to fetch the sitemap and display the status: Success (sitemap fetched successfully), with the number of URLs discovered.
After submission, Search Console shows your sitemap's status, the last time it was read, and any errors (URLs that could not be fetched, invalid entries). Check this dashboard after major site changes to ensure your sitemap remains error-free.
Also submit your sitemap to Bing Webmaster Tools — Bing is a secondary but meaningful traffic source that has its own sitemap submission process.
Sitemap Best Practices
- Keep it up to date — if your sitemap is generated dynamically (as it should be on most CMS platforms), it updates automatically as you add content. For manually maintained sitemaps, update the file whenever you add, delete, or significantly update pages.
- Use sitemap index files for large sites — Google allows a maximum of 50,000 URLs per sitemap file. Sites with more pages should use a sitemap index file that references multiple individual sitemaps (one for blog posts, one for products, one for pages, etc.).
- Include only canonical URLs — the URL in your sitemap should always be the canonical version (HTTPS, with or without trailing slash, whichever is your chosen canonical form).
- Avoid sitemap bloat — a sitemap with thousands of low-quality, duplicate, or noindex pages wastes crawl budget and can confuse Google about which pages to prioritise. A smaller, clean sitemap of your best pages is better than an exhaustive sitemap.
- Monitor sitemap errors in Search Console — regularly check the Sitemaps report in Search Console for warnings or errors. Common issues include sitemap URLs returning 404 errors (pages deleted without being removed from the sitemap) or sitemap files returning errors when fetched.
Frequently Asked Questions
Does having a sitemap improve SEO rankings?
A sitemap does not directly improve rankings — it helps Google discover and index your pages, but indexation is a precondition for ranking, not the ranking itself. The SEO benefit of a sitemap is ensuring that all your important pages are indexed (and therefore eligible to rank), especially for new or deep pages that might otherwise be missed by crawling alone.
What is the difference between a sitemap and robots.txt?
A sitemap tells search engines what pages exist and should be indexed — it is an invitation. A robots.txt file tells search engines what not to crawl — it is a set of restrictions. The two work together: robots.txt controls crawler access to directories and files; a sitemap guides crawlers to the specific URLs you want indexed. A URL that appears in your sitemap but is blocked in robots.txt sends conflicting signals — avoid including blocked URLs in your sitemap.
How do I check if Google has indexed my sitemap?
In Google Search Console: go to Indexing — Sitemaps. Your submitted sitemaps are listed with their status (Success or error), the date last read, and the number of URLs discovered. The "Discovered URLs" count from the sitemap may differ from the number of pages actually indexed — Google decides independently whether to index discovered pages based on quality signals.
Should I include images in my sitemap?
Image sitemaps (using the image extension to the XML sitemap format) help Google discover images, particularly on pages where images are loaded dynamically via JavaScript. For standard HTML pages with images in the source code, standard sitemaps are usually sufficient. Image sitemaps are most valuable for image-heavy sites (photography portfolios, stock image libraries, e-commerce product galleries) where image search traffic is a meaningful goal.