Key takeaways

  • An XML sitemap helps Google find your URLs. It does not guarantee that they will be crawled or indexed.
  • A small site of about 500 pages or fewer that is well linked internally may not need one.
  • List only canonical URLs you want in search, as absolute URLs in a UTF-8 file, up to 50MB or 50,000 URLs per file.
  • Google ignores priority and changefreq, and uses lastmod only when it is accurate.
  • Submit through Search Console’s Sitemaps report or a Sitemap line in robots.txt. Google retired the sitemap ping endpoint in 2023.

An XML sitemap is one of the simplest files on a website, and one of the most misunderstood. Most of the advice in older guides, including the first version of this one, was about tuning values Google does not read and pinging an address that no longer works. Generating a clean sitemap and submitting it properly takes an afternoon at most, and I check it at the start of every technical SEO review.

This guide covers generating the sitemap and submitting it. If Search Console already reports problems with a WordPress sitemap, my guide on fixing persistent WordPress sitemap errors picks up from there.

I first published this article in 2025 and have rewritten it, removing statistics I could not trace to any source and advice that no longer applies.

Do you need an XML sitemap?

Google’s sitemap overview describes a sitemap as “a file where you provide information about the pages, videos, and other files on your site”. It lists the cases where one helps most: “Your site is large.”, “Your site is new and has few external links to it.”, and “Your site has a lot of rich media content (video, images) or is shown in Google News.”

A small, well-linked site drawn as a compact cluster of connected pages beside a large sprawling site with many loose pages and a folded map file guiding toward them
Figure 1. Large, new or poorly linked sites gain most from a sitemap; a small, well-linked site may not need one.

It is equally clear about who may not need one. A small site, which Google defines as “about 500 pages or fewer”, that is “comprehensively linked internally” can be found without it. And it sets expectations: a sitemap “doesn’t guarantee that all the items in your sitemap will be crawled and indexed.”

In practice I still set one up on almost every site. Most platforms generate it for free, and a submitted sitemap gives you a per-sitemap view of indexing in Search Console, which is useful on its own.

What belongs in an XML sitemap

A sitemap is a list of the pages you want in search, not a list of every URL the site can produce. Google’s guide to building and submitting a sitemap notes that “Google generally shows the canonical URLs in its search results”, so the sitemap should name the URL you prefer for each page.

A sieve above an open folder, letting clean pages with green checks pass through while pages with a redirect arrow, a torn edge and a closed barrier are caught on top
Figure 2. Only canonical pages you want in search belong in the sitemap; redirected, blocked and broken URLs stay out.
URL type In the sitemap? Why
Canonical pages that return 200 Yes These are the pages you want found
URLs that redirect No List the final address instead
Pages marked noindex No You are asking Google to find a page you told it not to index
Filter, sort and tracking parameter URLs No List the canonical version only
Pages that return 404 or 410 No Remove them when the page goes
Staging or test URLs No They should not be public at all

The technical rules are short:

  • “Use fully-qualified, absolute URLs in your sitemaps”, on your preferred hostname and https.
  • “The sitemap file must be UTF-8 encoded.”
  • Place it at the root where you can. Google explains that “a sitemap affects only descendants of the parent directory”, while “a sitemap posted at the site root can affect all files on the site.”
  • “All supported formats limit a single sitemap to 50MB (uncompressed) or 50,000 URLs.” Larger sites split it into several files and list them in a sitemap index.

Priority, changefreq and lastmod

Many generators still add priority and changefreq tags. Google says plainly: “Google ignores <priority> and <changefreq> values.” It uses lastmod only when it is “consistently and verifiably (for example by comparing to the last modification of the page) accurate.” In its June 2023 announcement, Google said it uses lastmod “as a signal for scheduling crawls to URLs that we previously discovered”, and that it should reflect the “last significant modification”, not a changed footer or a new copyright year.

A minimal, valid entry looks like this:

<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
  <url>
    <loc>https://www.example.com/services/roof-repair/</loc>
    <lastmod>2026-11-20</lastmod>
  </url>
</urlset>

Free tool · SEO ROI Calculator

Adding your most important service pages to the sitemap? Estimate what the keywords behind them are worth.

Enter search volume, CPC and your current ranking to estimate traffic, revenue and value for a keyword. Free.

Calculate your SEO ROI →

How to generate an XML sitemap

Google notes that “Most content management systems (CMS) automatically generate sitemaps”. There are three realistic routes, and the right one depends on how the site is built.

  1. Your CMS or platform. The best option when it exists, because the sitemap updates whenever content changes. On WordPress, check whether the built-in sitemap or an SEO plugin’s sitemap is the one in use, and make sure only one of them is live and submitted.
  2. A crawler-based generator. Useful for a small static site. The risk is that it lists whatever it finds, redirects and parameter URLs included, and it goes stale the moment you publish something new unless you run it again.
  3. A custom sitemap from the database. For large shops and content sites. Split it by type (pages, products, categories, articles) and list the files in a sitemap index, so a problem in one file is easy to spot.

Whatever the route, generate the sitemap from the same source as the live site. A sitemap built once and uploaded by hand is out of date within weeks.

How to submit an XML sitemap to Google

Google lists several ways to submit a sitemap. These are the three that matter for most sites.

A sitemap file travelling along two paths to a magnifying glass, one through a settings panel and one through a robots file, while a third path with an old bell is crossed out
Figure 3. Submit through Search Console or a robots.txt line; the old ping route no longer works.
  • The Sitemaps report in Search Console. Enter the sitemap URL and submit. You need owner permissions for the property.
  • The Search Console API, for developers who manage many sites.
  • A line in robots.txt. Google says “Insert the following line anywhere in your robots.txt file”. It works without a Search Console account:
Sitemap: https://www.example.com/sitemap_index.xml

The sitemap ping endpoint is gone

Older guides, plugins and scripts still “ping” Google with the sitemap URL. On 26 June 2023 Google announced the “deprecation of the sitemaps ‘ping’ endpoint”, said “the endpoint will stop functioning in 6 months”, and that requests to it “will result in a 404 error.” Its reason was blunt: unauthenticated submissions “are not very useful”, and “the vast majority of the submissions lead to spam.” Google said you can still “submit your sitemaps through robots.txt and Search Console.”

So if a plugin or deployment script still sends a sitemap ping to Google, it is doing nothing useful for Google. Accurate lastmod dates in a sitemap Google already knows about are what count now.

Free tool · Ping My URL

Published a few new pages that are already in your sitemap? You can also send a quick notification for up to 5 URLs.

Paste up to 5 URLs and send a notification to a list of search engines and ping services. Free, no guarantee of indexing.

Ping your URLs →

After you submit, what to check

Google’s help page for the Sitemaps report explains its three statuses. “Success” means “The sitemap was loaded and processed successfully with no errors.” “Has errors” means “The sitemap could be fetched, but has one or more errors.” “Couldn’t fetch” means “The sitemap could not be fetched for some reason.” For the last one, check that robots.txt does not block the file, that the URL loads in a browser, and “Confirm the error in the URL Inspection tool.”

Then use the part of the report most people miss: “You can filter the Page indexing report by sitemap to see how many page URLs in this sitemap have been indexed.” Splitting sitemaps by type makes this filter far more useful, because you can see at once whether products, articles or service pages are the ones not being indexed.

Two more things worth knowing. Removing a sitemap from the report does not make Google forget it: “Google won’t forget the sitemap or any URLs listed in it.” And I do not resubmit an unchanged sitemap. Google already knows where it is.

A sitemap is a list of promises, so every URL in it should be a page you want found and every date in it should be true.

Rank Check Reports

Submitted a new sitemap after a relaunch? Check where your main keywords rank now and again once the new pages are indexed.

A live Google check of your keywords on desktop and mobile · from $14.99 per check · no subscription · report within one working day

Order a rank check report →

XML sitemap checklist

  1. Decide whether the site needs a sitemap. If it is large, new or poorly linked, it does.
  2. Generate it from the CMS or the database, not by hand.
  3. Include only canonical, indexable URLs that return 200, on your preferred hostname and https.
  4. Remove priority and changefreq if you like; Google ignores them. Keep lastmod only if it is accurate.
  5. Stay under 50MB uncompressed or 50,000 URLs per file, and use a sitemap index for more.
  6. Add the Sitemap line to robots.txt and submit the sitemap in Search Console.
  7. Turn off any old sitemap ping to Google in plugins or scripts.
  8. Check the Sitemaps report status, then filter Page indexing by sitemap.

FAQ

Does submitting an XML sitemap get my pages indexed?

Not on its own. Google says a sitemap does not guarantee that the items in it will be crawled and indexed. It helps Google find URLs; the pages still need to be worth indexing.

Should I still ping Google when my sitemap changes?

No. Google deprecated the sitemap ping endpoint in June 2023 and said it would stop working six months later. Keep lastmod accurate and submit through Search Console or robots.txt instead.

Do priority and changefreq matter?

Not for Google, which says it ignores both values. Leaving them in does no harm, but time spent tuning them is wasted.

Can I submit more than one sitemap?

Yes. Each file is limited to 50MB uncompressed or 50,000 URLs, and you can list several sitemaps in a sitemap index and submit that one file. Splitting by content type also makes the indexing data easier to read.

Eugen Platon

Eugen Platon

Director of SEO & Web Analytics at onwardSEO
Eugen Platon is a highly experienced SEO expert with 16+ years of experience propelling organizations to the summit of digital popularity. Eugen, who holds a Master's Certification in SEO and is well-known as a digital marketing expert, has a track record of using analytical skills to maximize return on investment through smart SEO operations. His passion is not simply increasing visibility, but also creating meaningful interaction, leads, and conversions via organic search channels. Eugen's knowledge goes far beyond traditional limits, embracing a wide range of businesses where competition is severe and the stakes are great. He has shown remarkable talent in achieving top keyword ranks in the highly competitive industries of gambling, car insurance, and events, demonstrating his ability to traverse the complexities of SEO in markets where every click matters. In addition to his success in these areas, Eugen improved rankings and dominated organic search in competitive niches like "event hire" and "tool hire" industries in the UK market, confirming his status as an SEO expert. His strategic approach and innovative strategies have been successful in these many domains, demonstrating his versatility and adaptability. Eugen's path through the digital marketing landscape has been distinguished by an unwavering pursuit of excellence in some of the most competitive businesses, such as antivirus and internet protection, dating, travel, R&D credits, and stock images. His SEO expertise goes beyond merely obtaining top keyword rankings; it also includes building long-term growth and optimizing visibility in markets where being noticed is key. Eugen's extensive SEO knowledge and experience make him an ideal asset to any project, whether navigating the complexity of the event hiring sector, revolutionizing tool hire business methods, or managing campaigns in online gambling and car insurance. With Eugen in charge of your SEO strategy, expect to see dramatic growth and unprecedented digital success.
Eugen Platon
Check my Online CV page here: Eugen Platon SEO Expert - Online CV.