Home › Blog › SEO › What Is an XML Sitemap? Why You Need One...
SEO

What Is an XML Sitemap? Why You Need One & How to Submit It

A transit map, an analogy for an XML sitemap
Image: ArielR20130725, CC0, via Wikimedia Commons

An xml sitemap is a file that lists the pages on your website that you want search engines such as Google to find and crawl. Think of it as a list you hand to Google directly, so it does not have to rely only on following links to discover your content.

This guide explains what an xml sitemap does and does not do, when you actually need one, how to create one with WordPress plugins such as Rank Math or Yoast, and how to submit it in Google Search Console. It also settles the common confusion between a sitemap and robots.txt, which do very different jobs. Every limit and rule below comes from Google’s own documentation, linked where it appears.

Quick Answer

An xml sitemap is a structured file (often at yoursite.com/sitemap.xml or sitemap_index.xml) that lists your site’s URLs to help search engines discover them. You do not write it by hand: SEO plugins and many platforms generate and update it, and you submit its URL once in the Sitemaps report in Google Search Console. It does not force Google to crawl, index or rank anything, but it helps discovery, which matters most for new, large, or poorly linked sites.

50,000maximum URLs in one sitemap file before you must split it, per Google
50 MBmaximum uncompressed size of one sitemap file, per Google
~500pages or fewer: Google says a well-linked site this small might not need a sitemap
2optional tags, priority and changefreq, that Google says it ignores

What Is an XML Sitemap in Plain English

An xml sitemap is a machine-readable file that lists the URLs on your website, optionally with a little metadata about each, such as when the page was last modified. XML stands for Extensible Markup Language, a structured format that both search engines and software can read reliably. Humans rarely need to look at the raw file.

A useful comparison is a building directory in a large shopping centre. Visitors can wander and eventually find your unit, or they can read the directory and go straight to it. A sitemap plays the directory’s role for crawlers, with one difference: Google treats it as a hint, not an instruction.

Here is what a single entry in a basic xml sitemap can contain:

  • loc — the full, absolute URL of the page, for example https://example.com/services/. Google asks for fully qualified URLs.
  • lastmod — the date the page was last significantly updated, which can hint that a recrawl is worthwhile.
  • changefreq — an optional hint about how often the page changes. Google ignores it.
  • priority — an optional 0.0 to 1.0 value. Google ignores it too.

Google’s sitemap documentation says it ignores priority and changefreq, and uses lastmod only if it is consistently and verifiably accurate. It also says the file must be UTF-8 encoded and that, besides XML, Google accepts RSS and Atom feeds and plain text files with one URL per line. For most sites, XML generated by a plugin is the simplest choice.

For reference, this is the minimal file shown in Google's documentation (Google: build and submit a sitemap):

<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
  <url>
    <loc>https://www.example.com/foo.html</loc>
    <lastmod>2022-06-04</lastmod>
  </url>
</urlset>

Three rules from the same page catch most hand-made files. The file must be UTF-8. Every URL must be fully qualified and absolute, because Google crawls URLs exactly as listed, so a relative path such as /mypage.html will not work. And all tag values must be entity-escaped, which means an ampersand in a URL is written as &amp;. To point crawlers at the file from robots.txt, add one line anywhere in it, for example Sitemap: https://example.com/my_sitemap.xml; you can list several.

The core idea in one line

An xml sitemap does not make Google rank you. It tells Google which pages you consider worth finding, so a page is not missed simply because no crawler reached it by following links.

Do You Actually Need an XML Sitemap?

Not every site does. Google’s sitemap overview says you might not need one if your site is small, meaning about 500 pages or fewer, and comprehensively linked internally, so that Googlebot can find all the important pages by following links from the home page. It lists the cases where a sitemap helps: your site is large, your site is new and has few external links to it, or it has a lot of rich media content or appears in Google News.

In practice, internal linking is often less complete than owners think, and a plugin adds a sitemap at no cost, so most sites include one. The decision is less about whether to have one and more about how much to rely on it.

Faster discovery of new and updated pages

When you publish a new post or product page, a sitemap gives Google a direct pointer to it instead of waiting for the crawler to reach it through a chain of links. For an active blog or a store adding inventory, that can help discovery, though Google decides when, and whether, to crawl.

Coverage for pages that are hard to reach

Some pages sit deep in your structure, behind filters, or are linked from nowhere prominent. These orphan or deep pages are easy for crawlers to miss. A sitemap lists them regardless of how they are linked internally. It is a safety net, though; the better fix for an orphan page is usually to link to it from a relevant page.

Better crawling for large and complex sites

Crawl budget, the amount of crawling Google will do on your site, is mainly a concern for large sites. Google’s crawl budget guide is aimed at sites with 1 million or more unique pages whose content changes about weekly, or 10,000 or more unique pages whose content changes daily, and at sites with many URLs in the Search Console status “Discovered - currently not indexed”. It advises keeping your sitemaps up to date and including lastmod for updated content. Handling this at scale is a typical part of technical SEO work.

Site typeSitemap?Why
Brand-new siteRecommendedGoogle lists “new with few external links” as a case where a sitemap helps
Large ecommerce storeRecommendedMany URLs and frequent changes make a clean list useful for discovery
Active blog or news siteRecommendedFrequent new content benefits from a pointer to each new URL
Site with weak internal linkingRecommendedOrphan and deep pages would otherwise be easy to miss
Small, well-linked brochure siteOptionalGoogle says about 500 pages or fewer may not need one, but a plugin adds it at no cost

How an XML Sitemap Helps Crawling and Indexing

A sitemap works at the first stages of a three-step process: discovery, crawling and indexing. It influences discovery directly, crawling slightly, and indexing hardly at all.

Discovery: finding the URL exists

Discovery is Google learning that a URL exists. Without a link to a page and without a sitemap entry, Google may never know it is there. A sitemap solves that by handing Google a list of the URLs you want considered.

Crawling: fetching and reading the page

Once a URL is known, Google schedules a crawl to fetch the content. A sitemap does not force or guarantee a crawl. Google’s documentation calls submitting a sitemap “merely a hint”. An accurate lastmod can help Google decide which pages to revisit, but it is a signal, not a command.

Indexing: deciding to store the page

This is the step people misunderstand most. Google’s Sitemaps report help states there is no guarantee that a URL discovered in a sitemap has been or will be crawled or indexed. Google still decides whether a page is worth storing, based on quality, uniqueness and other signals. A sitemap gets you to the door; your content and technical health decide what happens next.

The biggest sitemap misconception

A sitemap is a discovery aid, not a ranking tool and not an indexing guarantee. Adding a URL tells Google the page exists and that you consider it worth listing. It does not promise the page will be crawled quickly, indexed, or ranked. Treat it as one input among many.

Types of Sitemaps You Might Encounter

Most people mean a standard URL sitemap when they say xml sitemap, but other formats exist. Modern SEO plugins generate the ones you need, so you rarely manage them by hand.

Sitemap typeWhat it listsWhen it matters
Standard XML sitemapYour regular pages, posts, and productsAlmost every site
Sitemap indexA list of other sitemap filesLarger sites split across multiple files
Image and video extensionsExtra information about images or video on your pagesSites with a lot of rich media
News sitemapRecent articlesSites that appear in Google News
HTML sitemapA human-readable page of linksMainly a navigation aid for visitors

Do not confuse the last one, an HTML sitemap, with an xml sitemap. An HTML sitemap is an ordinary web page built for visitors; an xml sitemap is built for crawlers. They can coexist.

Sitemap index files explained

A single sitemap file is limited to 50,000 URLs and 50 MB uncompressed, so big sites use a sitemap index. The index does not list pages directly; it lists other sitemap files, such as one for posts and one for products. Per Google’s large sitemaps guide, an index can reference up to 50,000 sitemaps. When a plugin gives you an index file, you submit the index and Google follows it to the child sitemaps.

How to Generate an XML Sitemap on WordPress

On WordPress you almost never build a sitemap by hand. WordPress itself, or an SEO plugin, creates one and updates it as you publish or edit.

WordPress core

Since WordPress 5.5, core exposes a sitemap index at /wp-sitemap.xml, as described in the WordPress core announcement. Core turns sitemaps off if the Site Visibility setting discourages search engines from indexing the site, so if yours is missing, check that setting first. Plugins can also disable or replace core sitemaps.

Yoast SEO

Yoast’s XML sitemaps help page says to go to Yoast SEO, then Settings, then Site features, and switch the XML sitemaps toggle on under Technical SEO. Use the link to view the XML sitemap from there. Yoast notes that post types marked noindex do not appear in the sitemap. It also warns that a sitemap at example.com/sitemap.xml was probably created by another plugin or by WordPress core, not Yoast.

Rank Math

Rank Math has its own sitemap module, and its guide to submitting your sitemap shows entering sitemap_index.xml in Search Console’s “Add a new sitemap” field. Menu names change between plugin versions, so use the plugin’s current documentation to choose which post types and taxonomies to include.

The principle is the same with any tool: your sitemap should mirror your indexing intent. Google says to include the URLs you want to see in search results, which are the canonical URLs. If a page is set to noindex it should not be in the sitemap, because listing a URL you also tell Google not to index is a mixed signal. Keeping the two aligned is routine hygiene in a technical SEO audit.

Check it by eye first

Before you submit anything, open the sitemap in a browser and skim the URLs. You are looking for pages that should not be there: staging URLs, thank-you pages, cart and checkout pages, thin tag archives, and old test posts. A tight list of pages you want in search results is better than a padded one.

Other platforms

Most hosted website builders and online store platforms generate a sitemap automatically, but the location and any settings differ, so check your platform’s own help pages for the address instead of guessing. For custom-built sites, a developer can generate the file with a build script or a generator, as long as it follows the format in Google’s documentation. The submission process in Search Console is the same however the file was created.

PlatformSitemap generated automatically?Typical location
WordPress coreYes (unless search visibility is discouraged)/wp-sitemap.xml
WordPress + Yoast SEOYes, when the XML sitemaps feature is onShown in the Yoast settings (see its help page)
WordPress + Rank MathYes, via its sitemap modulesitemap_index.xml
Hosted builders and storesUsuallySee the platform’s help pages
Custom siteNo, must be builtWherever you place it, ideally the site root

Google recommends posting sitemaps at the site root, because a sitemap there can affect all files on the site, whereas one in a subdirectory by default affects only that directory’s descendants.

How to Submit Your XML Sitemap in Google Search Console

Generating the sitemap is half the job. Submitting it in Search Console tells Google where it is and lets you see whether Google can read it.

Step-by-step submission

  1. Verify your site in Search Console. Add and verify your property. Google’s help notes you need owner permissions on the property to submit a sitemap in the Sitemaps report.
  2. Find your sitemap URL. Open it in your browser first to confirm it loads.
  3. Open the Sitemaps report in Search Console.
  4. Enter the sitemap path. In the “Add a new sitemap” box, enter the sitemap URL or the path after your domain, then click Submit.
  5. Check the status. Google reports Success (loaded and processed with no errors), Has errors (fetched, but with one or more errors) or Couldn’t fetch.

You do not need to resubmit every time you publish. Google’s crawl budget guide says Google reads your sitemap regularly, and your plugin keeps the file current. Revisit the Sitemaps report to check for errors or confirm URL counts. The official build and submit guide lists the other methods: the Search Console API, a Sitemap line in robots.txt, or WebSub for RSS and Atom feeds.

Other search engines

Other search engines run their own webmaster tools, such as Bing Webmaster Tools, where you can submit the same file. Follow each engine’s own help pages, since the steps differ and change.

StepWhereHow often
Verify propertySearch ConsoleOnce
Submit sitemap URLSitemaps reportOnce
Google re-reads the fileAutomaticOngoing
Check for errorsSitemaps reportAfter big changes, and as a periodic check

XML Sitemap vs Robots.txt: What Is the Difference

A sitemap and a robots.txt file both live at your site’s root and both talk to crawlers, but they do different jobs.

Your xml sitemap is an invitation: here are the pages I want you to find. Your robots.txt is a set of instructions about which paths crawlers may request. One encourages discovery; the other restricts crawling.

AspectXML sitemapRobots.txt
PurposeLists URLs to help discoveryControls which paths crawlers may access
ToneInvitation to crawlInstruction and restriction
FormatStructured XML (or feed or text)Plain text directives
Typical locationSite root, for example /sitemap.xml/robots.txt
Controls indexing?No, only assists discoveryNo, it manages crawling, not indexing
Can reference the other?N/AYes, robots.txt can point to your sitemap

Google’s documentation says to add a Sitemap line to robots.txt giving the path to your sitemap, anywhere in the file, and that you can list more than one. Many SEO plugins add the line for you, but check yours.

A common trap

Google’s robots.txt introduction says robots.txt is not a mechanism for keeping a page out of Google, and that a page disallowed in robots.txt can still be indexed if other sites link to it. To keep a page out of search, use noindex (and let Google crawl the page so it can see the tag) or password-protect it, then remove the URL from your sitemap.

XML Sitemap Best Practices and Common Mistakes

A sitemap is easy to create and easy to get subtly wrong. Here is a pros-and-cons view.

✓ What a well-managed sitemap does

  • Lists only canonical, indexable, 200-status URLs
  • Updates automatically as you publish and edit
  • Stays within the 50,000 URL and 50 MB limits per file, split by index if needed
  • Excludes noindex, redirected, and duplicate pages
  • Uses accurate lastmod dates Google can trust
  • Is referenced in robots.txt and submitted in Search Console

✗ Common mistakes that hurt you

  • Including noindexed or redirected URLs, creating mixed signals
  • Listing 404 or broken pages
  • Padding the file with thin tag and archive pages
  • Faking lastmod dates so every page looks freshly updated
  • Forgetting to submit it in Search Console at all
  • Letting the file drift out of sync after a site migration

Keep the sitemap and canonical tags aligned

Every URL in your sitemap should be the canonical version of that page, the one URL you want shown in results. If you list both a URL and its parameter-laden duplicate, you send conflicting signals. Consistency between your sitemap, canonical tags and internal links is a mark of a technically healthy site.

Match freshness signals to reality

Google says it uses lastmod only when it is consistently and verifiably accurate, and describes it as the date of the last significant update. Bumping every page’s date after a trivial change, or bulk-editing every date to today, undermines the one optional tag Google may use. Let your plugin set lastmod from genuine content changes.

Validate before you rely on it

After any major change, redeploy or migration, reopen your sitemap and spot-check it. Confirm the URL count roughly matches your real page count, that the domain and protocol are correct (https, not http), and that no staging URLs leaked in. If you want clean page metadata to pair with a tidy sitemap, our free meta tag generator is a handy companion tool.

How to Monitor Sitemap Health in Search Console

Submitting the sitemap is not the finish line. The Sitemaps and Page indexing reports show whether Google is acting on the URLs you provided.

Submitted vs indexed

The Sitemaps report shows how many URLs Google discovered from the file. The Page indexing report then shows which are indexed and why others are not. A big gap between submitted and indexed usually points to content quality, duplication or thin pages rather than to the sitemap itself, though Google also notes it does not index every page it finds.

Reading common statuses

These names and meanings come from Google’s Page indexing report help. The suggested actions are our general guidance, not Google rules.

StatusWhat Google says it meansWhat to consider
Crawled - currently not indexedThe page was crawled but not indexedReview depth and uniqueness; it may not be a problem for every URL
Discovered - currently not indexedFound but not crawled yet; Google rescheduled the crawlCheck internal links and server speed; allow time
URL marked “noindex”Google found a noindex directiveRemove the URL from the sitemap if that is intended
Duplicate without user-selected canonicalA duplicate of another page, with no preferred canonical declaredDeclare a canonical and align internal links
Couldn’t fetch (Sitemaps report)The sitemap could not be fetchedOpen the URL yourself, check access and format

If most submitted URLs sit in Crawled or Discovered, not indexed, the sitemap did its job and the cause is elsewhere: content quality, internal links or site speed. Fiddling with the sitemap further will not fix it.

Sitemap size and splitting

If your site passes 50,000 URLs, or a file approaches 50 MB uncompressed, split it into several sitemaps listed in an index file. Many plugins do this for you by grouping content by type under one index. You rarely have to think about it until you reach genuinely large scale.

Troubleshooting Sitemap Errors in Search Console

The Sitemaps report gives each file one of three statuses: Success (fetched and read with no errors), Has errors (fetched, but with one or more errors; URLs that parsed cleanly are still queued) or Couldn't fetch (Google could not retrieve the file). The causes and fixes below come from Google's Sitemaps report help.

What you seeCause Google listsFix
Couldn't fetch: blocked by robots.txtGoogle respects robots.txt when fetching sitemapsRemove the rule that blocks the sitemap path
Couldn't fetch: 404Wrong URL or the file is missingOpen the URL in a browser, correct the path, resubmit
Couldn't fetch: general or server errorMay be temporaryWait and see whether later attempts still fail; run a Live test in URL Inspection on the sitemap URL
Couldn't fetch: manual actionSitemaps are not read while a manual action is unresolvedFix the issue in the Manual actions report, then resubmit
URL not allowedA listed URL is on a different domain, protocol or host (for example a missing www), or sits above or beside the sitemap's directoryHost the sitemap so it covers the URLs, and list only matching URLs
URLs not followedRedirect chains or relative URLsList final destination URLs, use absolute URLs, avoid JavaScript or meta-refresh redirects
Parsing errorOften an unescaped character such as an ampersand in a URLEscape it as &amp; and use straight quotes, not curly ones
Invalid dateDates must use W3C Datetime format; a time needs a time zoneUse a format like 2022-06-04
Too many URLs or file size errorMore than 50,000 URLs or over 50 MB uncompressedSplit into several sitemaps listed in a sitemap index
Nested sitemap indexesAn index lists another indexAn index may list only sitemaps

To debug a fetch error, run a Live test in the URL Inspection tool on the sitemap URL and confirm that "Crawl allowed?" shows Yes and "Page fetch" shows Successful.

An Illustrative Sitemap Workflow (Not a Real Client)

Here is a hypothetical scenario. Say you run a home-services company with a WordPress site, 40 service and location pages, and a blog.

  1. Install and configure. You activate your SEO plugin, confirm its sitemap feature is on, and include services, locations and posts while excluding tags and author archives.
  2. Review the file. You open the sitemap index in a browser, click into the child sitemaps, and confirm only real, indexable pages appear. You spot an old thank-you page and set it to noindex, which removes it from the sitemap.
  3. Reference in robots.txt. You confirm robots.txt includes a Sitemap line pointing to the index.
  4. Submit in Search Console. You add the sitemap in the Sitemaps report and check that the status reads Success.
  5. Monitor. A few weeks later you open the Page indexing report, notice three thin location pages sitting in Crawled - currently not indexed, and expand them with unique local detail.
  6. Repeat after changes. After a redesign, you recheck the sitemap for staging URLs and wrong counts.

The routine is the same for any size of site: a clean, submitted, monitored sitemap. If you would rather have it handled alongside site speed, crawlability and indexing, that is within the scope of our technical SEO work.

Honest limits

We cannot promise that a sitemap will get a page indexed or ranked, and we do not guarantee rankings. Plugin menus and Search Console labels change, so follow the current Google and plugin documentation if a step looks different. Indexing problems usually trace back to content quality or technical issues that a sitemap cannot fix, and some of those fixes need developer access to your site.

Key Takeaways

  • An xml sitemap lists the URLs you want search engines to find and crawl.
  • It aids discovery, but Google says submitting one is a hint and gives no guarantee of crawling or indexing.
  • On WordPress, core or an SEO plugin generates and updates it for you.
  • Submit it once in the Sitemaps report in Search Console, then let Google re-read it.
  • A sitemap invites crawling, while robots.txt manages crawling. They are complementary, and robots.txt is not a way to keep pages out of Google.
  • Keep the file clean: canonical, indexable URLs only, honest lastmod dates, and no noindexed pages. Google ignores priority and changefreq.

Frequently Asked Questions

What is an xml sitemap in simple terms?

It is a structured file that lists the pages on your website so search engines can find and crawl them more easily. You do not read it yourself; it exists for crawlers like Googlebot. Most SEO plugins generate it automatically, so you mainly just submit its URL to Google Search Console once.

Where do I find my xml sitemap?

Try yoursite.com/sitemap_index.xml or yoursite.com/sitemap.xml in your browser. WordPress core uses /wp-sitemap.xml, and SEO plugins and hosted platforms use their own locations, so check the plugin or platform help if none of these load. You can also look for a Sitemap line in your robots.txt.

Does an xml sitemap improve my SEO rankings?

Not directly. A sitemap helps Google discover and crawl your pages, which is a prerequisite for ranking, but it does not boost rankings on its own. Rankings depend on content quality, relevance, authority and technical health. Think of the sitemap as helping discovery rather than as a ranking factor.

How often should I update or resubmit my sitemap?

You do not resubmit it manually after the first time. SEO plugins keep the file current as you publish or edit, and Google reads it regularly. Revisit the Sitemaps report in Search Console to check for errors or confirm URL counts after major changes like a redesign or migration.

What is the difference between a sitemap and robots.txt?

An xml sitemap lists the URLs you want search engines to find, acting as an invitation. Robots.txt tells crawlers which paths they may or may not request, acting as a restriction. They serve different purposes, though your robots.txt can include a line pointing to your sitemap so crawlers find it quickly.

How many URLs can an xml sitemap contain?

A single sitemap file can hold up to 50,000 URLs and must stay under 50 MB uncompressed, according to Google's documentation. Larger sites split content across multiple sitemap files grouped under a sitemap index. Many plugins handle this splitting automatically.

Why are my sitemap pages not getting indexed?

Being in a sitemap does not force indexing. If pages show as Crawled - currently not indexed or Discovered - currently not indexed in Search Console, the sitemap did its job but Google has not indexed or crawled them yet. The usual levers are better content and internal linking, not changes to the sitemap.

Do small websites need an xml sitemap?

Not always. Google says you might not need one if your site has about 500 pages or fewer and is comprehensively linked internally. Adding one costs almost nothing with a plugin and can help Google find any page your links miss, so most small sites include one. New sites and large stores benefit most.

Why does Search Console say Couldn't fetch for my sitemap?

Google lists these causes: the file is blocked by robots.txt, the URL returns 404, a temporary server error, or an unresolved manual action. Open the sitemap URL in a browser to confirm it loads, check that robots.txt does not block it, and run a Live test in the URL Inspection tool on the sitemap URL. Server errors may clear on their own, so wait before resubmitting.

Can a sitemap list URLs from another domain or from the non-www version?

Not reliably. Google reports a URL not allowed error when a listed URL is on a different domain, protocol or host, such as a missing www, or sits above or beside the sitemap directory. Keep the sitemap host and the listed URLs identical, with the same protocol and www choice.

Want a second opinion on how Google sees your site?

Request a free audit and we will check your sitemap, robots.txt and Search Console coverage, then tell you what we would fix first. We reply within 1 business day. We cannot promise rankings, but you will get clear next steps. If you want ongoing help, our technical SEO service starts from $649/month as a published starting price for the smallest plan, not a quote.

Explore more from Arb Digital

Arb Digital — a digital marketing agency serving clients worldwide, using white-hat methods that follow Google and Bing guidelines — transparent monthly reporting, monthly plans with no lock-in (cancel with 30 days’ notice; prepaid periods and one-time projects have their own terms), and no guaranteed rankings.

Share: Facebook X Pinterest
Keep Reading

Related Articles

Arb Digital

Want This Done For Your Business?

A digital marketing agency serving clients worldwide — SEO, paid ads, content and web design. White-hat methods that follow Google and Bing guidelines, transparent monthly reporting, and no lock-in on monthly plans.