XML Sitemaps Explained — How to Create, Submit, and Optimize Your Sitemap for Better SEO
You've published 50 blog posts, but Google has only indexed 18. Your product pages aren't showing up in search at all. And you're wondering why your carefully crafted content is invisible. The answer is probably sitting in your root directory — or more accurately, not sitting there.
What a Sitemap Actually Does (and Doesn't Do)
Let's clear up the biggest misconception first: a sitemap does not improve your rankings. It doesn't make Google like your content more, rank you higher, or give you any direct SEO boost. What it does is ensure Google knows your pages exist.
Think of it this way. Google's crawler (Googlebot) discovers pages by following links. It starts from pages it already knows and follows every link to discover new ones. This works great when your site has excellent internal linking and every page is reachable within 3-4 clicks from the homepage.
But most websites aren't that well-structured. Product pages buried in category trees, blog posts with no sidebar links, landing pages created for ads that have no internal links — these pages become invisible to crawlers. A sitemap solves this by giving Google a complete list upfront. It's like handing a librarian a catalog instead of making them wander every aisle.
Here's the nuance most guides miss: having a sitemap doesn't guarantee indexing. Google still decides whether each page is worth indexing based on quality, uniqueness, and crawl budget. But without a sitemap, Google might not even find the page to make that decision.
The Anatomy of an XML Sitemap
An XML sitemap is a text file in XML format that follows the Sitemap Protocol 0.9 standard. Despite the technical-sounding name, the structure is straightforward.
Every sitemap starts with an XML declaration and a <urlset> root element with the sitemap namespace. Inside, each page gets a <url> block containing up to four elements.
<loc> is the only required element. It's the full URL of the page, including the protocol. This must match exactly how you want Google to index the URL — if you use trailing slashes on your site, include them here.
<lastmod> tells search engines when the page content last changed. This should be a real date, not today's date auto-generated on every build. Google has explicitly said they use lastmod to decide whether to re-crawl a page, but only when the dates are accurate.
<changefreq> hints how often the page is likely to change. Google has stated they largely ignore this tag, preferring to determine crawl frequency from their own observations. It's still included for compatibility with other search engines.
<priority> indicates relative importance within your site. Google has also said they don't use this tag much. However, Bing and other engines may consider it. Use it as a guide for your own reference if nothing else.
Which Websites Need a Sitemap the Most?
Not all websites benefit equally from sitemaps. Here's how to assess whether yours needs one urgently, eventually, or not at all.
Urgently need a sitemap:
- New websites with fewer than 50 backlinks — Google doesn't know you exist yet
- E-commerce stores with hundreds of product pages behind faceted navigation
- Websites that recently changed their URL structure or migrated domains
- Sites with large archives of content (news sites, blogs with 500+ posts)
- Single-page applications (SPAs) where JavaScript renders content dynamically
Should have a sitemap but it's not urgent:
- Established blogs with 20-100 well-linked pages
- Business websites with 10-30 pages
- Portfolio sites with gallery pages
Can probably skip a sitemap:
- Personal sites with fewer than 10 pages, all linked from the homepage
- Sites where every page is reachable within 2 clicks and Google already indexes everything
Even for the "can skip" category, we still recommend having one. It takes 5 minutes to create and there's zero downside. Think of it as an insurance policy for your SEO.
How to Submit Your Sitemap to Google Search Console
Creating the sitemap is half the job. You also need to tell Google where to find it. Here's the step-by-step process.
- Upload the file. Place your
sitemap.xmlfile in your website's root directory. It should be accessible athttps://yourdomain.com/sitemap.xml. Test by visiting this URL in your browser — you should see the XML code. - Open Google Search Console. Go to
search.google.com/search-consoleand select your property. If you haven't verified your site yet, you'll need to do that first. - Navigate to Sitemaps. In the left sidebar, click "Sitemaps" under the "Indexing" section.
- Enter the sitemap URL. Type
sitemap.xmlin the "Add a new sitemap" field and click Submit. - Verify the status. Google will show the submission status. It may take a few minutes to hours for Google to fetch and process the sitemap. Once processed, you'll see the number of URLs discovered and any errors.
You can also reference your sitemap in your robots.txt file by adding this line: Sitemap: https://yourdomain.com/sitemap.xml. This ensures that any search engine reading your robots.txt automatically discovers your sitemap.
Priority Settings: What Most People Get Wrong
Here's what most people get wrong about priority: they set every page to 1.0. If everything is the highest priority, nothing is the highest priority. Priority is relative — it tells search engines which of your pages matter more compared to other pages on your site.
A sensible priority structure looks like this:
- 1.0: Homepage only
- 0.9: Main category/section pages
- 0.8: Important product pages, key service pages
- 0.7: Regular blog posts, standard pages
- 0.5: Archive pages, tag pages (default)
- 0.3: Legal pages, privacy policy, terms of service
This creates a gradient that actually communicates something meaningful. Your homepage gets crawled first, your important pages get crawled early, and low-value pages get crawled when the crawler has spare budget.
That said, Google has stated they largely ignore the priority tag. But Bing and Yandex may use it, and it doesn't hurt. More importantly, maintaining a priority structure forces you to think about your own content hierarchy — which is valuable regardless of how search engines use the tag.
Common Sitemap Mistakes That Hurt Your SEO
Including URLs that return 404 or redirect. Every URL in your sitemap should return a 200 status code. Including broken URLs wastes your crawl budget and tells Google you don't maintain your site properly. Regularly audit your sitemap against actual page status.
Including noindex pages. If you've told Google not to index a page via meta robots or X-Robots-Tag, don't include it in your sitemap. The conflicting signals confuse crawlers — you're simultaneously saying "here's an important page" and "don't index this page."
Not updating lastmod dates. Setting lastmod to today's date on every sitemap regeneration — even when pages haven't changed — teaches Google to ignore your lastmod data entirely. Only update lastmod when the page content actually changes. This is especially important for news sites where freshness signals matter.
Using HTTP URLs when your site is HTTPS. Your sitemap URLs must match your canonical URLs. If your site uses HTTPS (which it should), every URL in your sitemap must also be HTTPS. Mixing protocols creates confusion about which version is canonical.
Forgetting to update after site changes. Adding new pages, deleting old ones, or changing URL structures without updating your sitemap defeats its purpose. Automate sitemap generation where possible, or schedule regular manual updates.
Sitemap Index Files: When You Need Multiple Sitemaps
A single sitemap can contain up to 50,000 URLs and must be under 50MB uncompressed. If your site exceeds either limit, you need multiple sitemaps organized under a sitemap index file.
Even if your site has fewer than 50,000 URLs, splitting sitemaps by content type (pages, posts, products, categories) makes them easier to manage and monitor. In Google Search Console, you can see indexing status per sitemap, which helps you identify problems in specific content areas.
WordPress with Yoast SEO or Rank Math automatically generates sitemap index files with separate sitemaps for posts, pages, categories, and tags. If you're on a custom-built site, you'll need to create this structure yourself.
Real Impact Stories: What Happened After Adding a Sitemap
🇮🇳 A Dropshipping Store in Jaipur — Product Discovery
Raghav's store had 320 products imported from suppliers. After 6 weeks, only 45 were indexed. The product pages had minimal internal linking — each was only reachable through 2-3 category pages.
He generated a sitemap with all 320 product URLs at 0.8 priority with weekly frequency, submitted it to Search Console, and waited.
Result: Within 10 days, 280 products were indexed. Within a month, all 320 were indexed. Organic traffic to product pages increased from near-zero to 450 daily visits.
🇮🇳 A News Blog in Mumbai — Crawl Efficiency
A regional news site published 20-30 articles daily. Google was crawling the site but often missed breaking news articles for 6-12 hours. The sitemap was outdated, regenerated only weekly.
They switched to dynamic sitemap generation (updated on every publish) with accurate lastmod timestamps. Breaking news articles got changefreq: always while evergreen articles got monthly.
Result: Average time to indexing for new articles dropped from 8 hours to under 90 minutes. Google News inclusion rate improved significantly.
🇬🇧 An Agency Portfolio in London — Migration Recovery
A design agency migrated from Squarespace to WordPress, changing every URL. Old URLs were 301-redirected, but the new WordPress sitemap only contained 12 pages (the ones with published content so far) instead of the 85 pages that had been migrated.
After creating a complete sitemap with all 85 new URLs and submitting it alongside proper redirects, Google picked up the new structure.
Result: Rankings recovered fully within 3 weeks instead of the projected 2-3 months. The sitemap gave Google a clear map of the new URL structure rather than making it follow redirect chains.
Specialized Sitemaps: Images, Videos, and News
Beyond the standard URL sitemap, Google supports specialized sitemap extensions for specific content types.
Image Sitemaps help Google discover images that it might not find through regular crawling — such as images loaded via JavaScript or images in a content delivery network (CDN). You add image tags within the URL element of your standard sitemap. In practice, most sites don't need a separate image sitemap because Google discovers images by crawling the pages they appear on.
Video Sitemaps provide metadata about videos on your pages — title, description, duration, thumbnail URL, and whether the video can be embedded. This helps Google display rich video snippets in search results. If you host videos directly on your site (not embedded from YouTube), a video sitemap can significantly improve their discoverability.
News Sitemaps are specifically for Google News publishers. They only include articles published within the last 48 hours and include additional tags for publication name, language, and title. If you're applying for Google News inclusion, a properly formatted news sitemap is essentially mandatory.
Automating Sitemap Generation
Manually updating your sitemap every time you publish content isn't sustainable. Here are the best ways to automate it based on your platform.
WordPress: Yoast SEO, Rank Math, and All-in-One SEO all generate and update sitemaps automatically. They handle new posts, deleted posts, and changed URLs without any manual intervention. WordPress 5.5+ also includes a basic built-in sitemap at /wp-sitemap.xml.
Shopify: Automatically generates and maintains a sitemap at /sitemap.xml. It's a sitemap index that links to separate sitemaps for products, collections, blogs, and pages. No plugins needed.
Custom/Static sites: Use build tools. If you're using a static site generator (Hugo, Gatsby, Next.js, 11ty), they all have sitemap generation plugins. For completely custom sites, write a script that reads your page list and generates the XML — it's a straightforward templating exercise.
For any platform: After automated generation, ping Google to let them know the sitemap has changed. Send a GET request to https://www.google.com/ping?sitemap=https://yourdomain.com/sitemap.xml. Many CMS plugins do this automatically on publish.
Sitemaps and Crawl Budget: What Enterprise Sites Need to Know
For sites with thousands or millions of pages, sitemaps interact with an important concept called crawl budget — the number of pages Google will crawl on your site in a given time period.
Google determines your crawl budget based on two factors: crawl rate limit (how fast they can crawl without overloading your server) and crawl demand (how much Google wants to crawl your content based on popularity and freshness).
Your sitemap influences crawl demand. By including only important, indexable URLs and keeping lastmod dates accurate, you help Google prioritize which of your pages to crawl. Including low-quality pages, duplicate pages, or redirect chains in your sitemap wastes crawl budget on pages that don't deserve it.
For large sites, we recommend auditing your sitemap quarterly. Remove URLs that have been deindexed or that you don't want indexed. Check that every URL returns a 200 status. Verify lastmod dates are accurate. This housekeeping directly impacts how efficiently Google crawls your most important content.
Sitemap Concepts Across Languages
Understanding XML Sitemaps Globally
Your Sitemap Action Plan
Stop overthinking and start executing. Here's your five-minute action plan.
- List every important page on your website — homepage, service pages, product pages, blog posts, category pages.
- Generate your sitemap using our sitemap generator tool. Set realistic priorities — not everything is 1.0.
- Upload the file to your root directory at
/sitemap.xml. - Submit it in Google Search Console and Bing Webmaster Tools.
- Add a reference in your
robots.txtfile. - Set a calendar reminder to review and update the sitemap monthly.
That's it. Six steps, five minutes, and you've eliminated one of the most common technical SEO problems. Your pages will be discovered faster, indexed more reliably, and you'll have a foundation for every other SEO improvement you make.
Create Your XML Sitemap Now
Ready to generate a valid XML sitemap for your website? Use our tool with bulk URL entry, custom priority settings, and instant download.
Generate Your Sitemap Now →Recommended Hosting
Hostinger
If you are building a website for your tools, blog, or store, reliable hosting matters for speed and uptime. Hostinger is a popular option used worldwide.
Visit Hostinger →Disclosure: This is a sponsored link.
