XML sitemap: what to put in it and how to submit it to Google

  • Home
  • XML sitemap: what to put in it and how to submit it to Google
XML sitemap: what to put in it and how to submit it to Google

An XML sitemap is simply a file listing the URLs you want to show Google. Only canonical, working pages go into it. Then you submit it in the robots.txt file and in Google Search Console. That’s it.

New pages take a long time to appear in search, and you don’t even know whether your site has a sitemap.xml or what is in it? Below I show how to check that and fix it. One caveat up front: for Google, a sitemap is only a hint. It does not guarantee indexing or higher search rankings.

What is an XML sitemap and when does it really help?

It is a file in XML format with a list of the site’s URLs. You can add extra information next to each URL, such as the date of the last change. Google also accepts sitemaps as RSS, mRSS, Atom and even a plain text file, but XML lets you do the most. According to Google’s introduction to sitemaps, a sitemap is useful mainly on large or frequently changed sites, in stores with lots of products, on sites with many images and videos, and on sites shown in Google News.

A sitemap complements internal linking. It does not replace it. If no link from the rest of the site leads to a page, that page still sends a weak signal, even if it is listed in the file. The crawler will find the URL more easily, sure. But what gets into the index is decided by Google, not by you.

What to put in sitemap.xml and what to throw out

The rule is simple: only the URLs you want to see in search results go into the sitemap. In practice that means:

  • canonical URLs, meaning the main versions of pages, not their copies,
  • pages that return a 200 status code (in other words, working ones),
  • pages meant for the index, without a noindex tag,
  • one version of the protocol and domain, e.g. only https and only with www.

What goes out? Redirects, 404 pages, URLs with noindex and duplicates that differ only in their parameters. In a store these are most often filter combinations (a topic for a separate conversation, more in the article on how store filters and indexing affect each other).

The lastmod tag says when a page last changed. According to Google’s documentation on building sitemaps, the search engine takes it into account only when the value is consistently and verifiably accurate. So no, don’t set today’s date on every URL. Google will catch that. The same documentation says that priority and changefreq are ignored, so they are not worth your time. XML extensions, on the other hand, let you describe images, videos, news and language versions. Do you have a site in several languages? You will find hreflang in the sitemap useful.

File limits and the sitemap index for a larger site

A single sitemap file has a limit on its size and on the number of URLs. The current values are in the Google documentation linked above. The site doesn’t fit? You split the sitemap into several files and create a sitemap index file that points to each of them. Then you submit only the index.

In my opinion it is best to split by content type: posts, pages, products and categories separately. When the report shows errors, you know right away which part of the site they concern. Maintaining a sitemap by hand on a large, frequently changed site is basically asking for trouble. Let the CMS or a plugin generate it.

The sitemap in WordPress: where to look for it

WordPress creates a sitemap on its own at /wp-sitemap.xml. SEO plugins usually replace it with their own. Here is how it looks on our side: web-systems.pl has a sitemap generated by Rank Math at /sitemap_index.xml, and /wp-sitemap.xml redirects to it permanently (as of September 2026).

On your own site, type /sitemap_index.xml, /sitemap.xml and /wp-sitemap.xml in the browser after the domain name, one after another. Then look into the settings of your SEO plugin. Found the file? Then go through what is in it. Technical pages, empty tags, attachment pages and URLs with noindex should not be there.

How to submit an XML sitemap to Google step by step

There are two ways: the robots.txt file and Google Search Console. Ideally use both. Four steps:

  1. Work out the full URL of the sitemap or sitemap index, including https.
  2. In the robots.txt file in the root directory of the domain, add a line in the form Sitemap: https://example.com/sitemap_index.xml.
  3. In Google Search Console, open the Sitemaps report, paste the URL and confirm.
  4. Check the processing status and the number of discovered URLs.

The report shows errors? Search Console has its own troubleshooting guide for sitemaps. Oh, and with several domains, each site points to its own sitemap in its own robots.txt, even if all the files sit on the same server.

The sitemap is there, but new pages are still not in Google - what to check

A sitemap speeds up the discovery of a URL. Nothing more. Indexing of new pages also depends on content quality, internal links and on nothing technically blocking the crawler. The most common culprits:

  • a noindex tag or a block in robots.txt,
  • a canonical URL pointing to a different page,
  • an orphan page, with no link from the site at all,
  • content that duplicates a page that already exists.

Did you change your URLs? Then you need an up-to-date sitemap and a well-thought-out redirect plan for a redesign. If the cause is not visible to the naked eye, a technical SEO audit of the site will help, and further work on visibility is handled by SEO for a company website.

A good XML sitemap? A clean file with nothing but canonical URLs, an honest lastmod, submission in robots.txt and Search Console, and regular visits to the report. Nothing more. Start by checking what is in your file today.

Frequently asked questions

Does a small company website need an XML sitemap?

With a dozen or so well-linked pages, Google will usually find them even without a sitemap. But the file costs nothing, and in WordPress it is created on its own anyway. Just check that it has no unnecessary URLs in it, and submit it.

Does a sitemap guarantee indexing?

No. It is a hint for Google, nothing more. Whether a page gets into the index depends on its quality and on whether the crawler can access it. A sitemap only helps find the URL faster.

How often should you update sitemap.xml?

With every content change, ideally automatically through the CMS or a plugin. If the sitemap URL does not change, you do not need to resubmit it in Search Console after every update.

Book a free consultation

Provide your phone number or schedule a meeting