XML Sitemaps: Create, Submit and Fix Your Sitemap

Illustration of a sitemap submission screen beside a person holding a tablet

An XML sitemap is a file that lists the website URLs you want search engines to discover. It can also describe meaningful updates and certain media or language relationships. For most business websites, the useful task is to maintain an accurate sitemap, submit its location and investigate any problems with the URLs it contains.

A sitemap does not make every listed page worth indexing. It cannot override a noindex instruction, repair a broken URL or guarantee a ranking. Its value comes from giving search engines a clear, current list that agrees with the rest of your website.

This is the practical sitemap workflow. For the wider relationship between crawling, indexing, rendering and canonical URLs, use our technical SEO guide.

What an XML sitemap does, and when it helps

Search engines can discover pages through links. A sitemap provides another way to find those URLs, particularly on a new website with few external links, a large catalogue or a site publishing substantial amounts of new content.

A small website with clear internal links may already be easy to discover. If its platform generates a sitemap automatically, keeping that file accurate is still a sensible maintenance task. Google explains these situations in its sitemap overview, which also makes clear that submission does not guarantee crawling or indexing.

Keep three different things separate:

  • An XML sitemap lists URLs and supported metadata for search engines.
  • A sitemap index lists individual sitemap files, such as separate files for posts and pages.
  • An HTML sitemap is a normal webpage containing links for visitors. Search engines can follow those links too, but it serves a different purpose from the XML file.

A visual diagram used to plan a website is different again. You do not need to reproduce your menu hierarchy or draw a flowchart inside an XML sitemap.

Find the sitemap your website already produces

Check the website’s SEO settings before installing another generator. Common locations include /sitemap_index.xml, /sitemap.xml and, for WordPress core sitemaps, /wp-sitemap.xml. The active address depends on the platform and plugins; these are places to check, not files every website must have.

You can also open /robots.txt and look for a Sitemap: line. If a sitemap index opens, follow one of its child sitemap links to see the actual page entries. Finding an index alone does not confirm that every child file is accessible.

On a WordPress website using Yoast SEO, open Yoast SEO → Settings → Site features. Under Technical SEO, enable XML sitemaps if needed, then select View the XML sitemap. These are the steps in Yoast’s current documentation.

Choose one active system to manage sitemap generation. Multiple sitemap files are normal when they belong to a single index; several competing plugins publishing inconsistent lists are a different issue. If you are choosing an SEO plugin, our WordPress SEO plugin comparison covers that decision separately.

Choose which URLs belong in the sitemap

For a normal production sitemap, include the preferred public URLs you want in search results. Make the listed address agree with the page’s canonical URL and the links you use elsewhere on the website. Google treats sitemap inclusion as a canonicalisation signal, but it is weaker than redirects or canonical annotations. Its canonical URL guidance explains how those signals work together.

URL you findSitemap decisionWhat to check
A useful service page or article returning 200Include its preferred URL.It is public, intended for indexing and uses the correct canonical.
An old URL that redirectsUse the final replacement URL instead.The redirect reaches the intended page and internal links use the new address.
A page intentionally marked noindexExclude it.The noindex decision is deliberate, rather than a leftover setting from development.
A deleted URL returning 404 or 410Remove the entry.The removal is intentional. If content moved, provide its relevant replacement separately.
A tracking URL or duplicate versionNormally list the clean canonical URL.Parameters have not created several entries for the same content.
A category or product variationDecide according to its actual search purpose.It offers a distinct useful page and is intentionally indexable; do not exclude every category or variation automatically.

Removing a URL from the sitemap does not remove the page from Google. Search engines may still discover it through links. If a page should not appear in search, make the appropriate indexing or removal decision on the page itself; the sitemap should reflect that decision.

In Yoast, excluding a post type from search also removes it from the sitemap. Review the consequences before changing that setting just to make a sitemap shorter. Yoast’s sitemap customisation guidance distinguishes content settings from more specialised filters.

Understand a simple XML sitemap example

sitemap website

This illustrative file contains one page. The example address and modification date must be replaced with real information; do not upload this sample over a sitemap your website already generates.

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

urlset contains the page entries, url groups one entry, and loc holds the full URL. The optional lastmod describes the page’s last modification. Use valid XML and escape reserved characters where necessary, such as an ampersand in a URL. The Sitemaps protocol provides the format rules.

For an active business website, automatic generation is usually easier to maintain than a hand-edited file. A one-time export will not necessarily update when you publish, redirect or delete a page. Establish who or what keeps it current.

Use lastmod honestly and ignore unnecessary priority work

Google ignores the sitemap fields priority and changefreq. Giving a service page a priority of 1.0 does not instruct Google to rank it first.

Google can use lastmod when it is consistently accurate. It should reflect a significant change to the page, such as an update to its main content, structured data or links. A changed copyright year is not a meaningful content update. These distinctions are documented in Google’s sitemap building guidance.

After a substantial rewrite, compare that page’s entry with a page you have not changed. If every URL receives a new modification date whenever the file regenerates, investigate the generator rather than treating the changing dates as an SEO advantage.

Do not confuse a page’s lastmod with the modification information for a child sitemap in a sitemap index. They describe different resources.

Submit the sitemap and check what Google actually reports

Make sure the file is publicly accessible, then use an owner account for the appropriate Search Console property. Open Sitemaps, enter the sitemap location in Add a new sitemap and submit it. When your website uses a sitemap index, that is normally the starting point.

Open the submitted entry to review its status and any reported errors. Success means Google processed the sitemap; it does not establish that every listed page is indexed. Google’s Sitemaps report documentation explains submission and report interpretation.

Keep a small verification record: the submitted address, the check date, any reported issue and a few important URLs to inspect. For a service business, those might include the main service page, a recently rewritten article and a newly published location page.

You do not need to submit the same unchanged sitemap every day. Keep it accessible and current. Older tutorials may recommend Google’s sitemap ping endpoint; that endpoint has been deprecated. Use current submission methods rather than copying an obsolete ping URL.

Fix sitemap errors at the right level

Separate problems with the sitemap file from problems with a page listed inside it. A perfectly readable file can contain unsuitable URLs, and a useful page can be omitted from an otherwise valid file.

What you noticeWhat to investigate firstHow to verify the fix
The sitemap cannot be fetchedWrong address, server errors, access rules, login requirements or a security challenge.The intended endpoint returns the sitemap publicly, and Search Console can fetch it.
The response is HTML rather than sitemap XMLA redirected homepage, error template or security page being served at the sitemap address.Inspect the response content, not just a 200 status or the file extension.
The XML has a parsing errorMalformed tags, unescaped characters or output inserted by a plugin before the XML document.The corrected document parses successfully and the reported line error is resolved.
An important page is missingPublication status, indexability, canonical settings and generator exclusions.The correct public URL appears in the appropriate child sitemap after the underlying setting is fixed.
Old URLs remain after changesStatic exports or cached sitemap responses.Fresh responses contain the current entries and no longer list the retired URLs.
The sitemap succeeds, but a page is not indexedThe individual URL’s indexing status and Google-selected canonical.Use URL Inspection to investigate that page instead of repeatedly rebuilding the sitemap.

For plugin-specific causes of malformed XML, missing entries and unexpected HTML responses, consult Yoast’s sitemap error reference.

For Yoast sitemaps that do not update, check caching at the plugin, hosting and CDN layers. Yoast provides specific troubleshooting guidance. Clear or exclude the affected sitemap response as appropriate, then recheck the actual content.

One detail often causes unnecessary concern: Yoast can send an X-Robots-Tag: noindex, follow header on the XML sitemap itself. The file does not need to appear in search results for Google to read it. That is different from a noindex instruction on a service page listed inside the file.

If the individual page remains excluded, the next investigation belongs to indexing and page quality. Our guide to why a website is not ranking on Google helps separate those cases.

A practical check after merging two articles

Suppose a business combines two overlapping articles into one stronger guide. The old article redirects to the retained guide, which has been updated with the useful material. Checking only that the redirect works leaves part of the job unfinished.

  1. Open the old URL. Confirm that it redirects to the intended replacement without an unnecessary chain.
  2. Open the retained URL. Confirm that it returns a successful response and has the intended indexing and canonical settings.
  3. Check the sitemap. The current entry should be the retained guide. Remove the redirecting source from the normal sitemap.
  4. Update internal links. Link directly to the retained page and give it a relevant place in the site’s navigation or supporting content.
  5. Review the reported status later. Google’s records may take time to reflect the change; a successful browser test is not proof that Google has already processed it.

This workflow applies to a specific content merge. A full domain migration can have different temporary sitemap monitoring arrangements and needs its own migration plan.

A small sitemap is not the objective by itself. A clear set of useful, correctly maintained pages is. Do not delete a distinctive article just because another page uses some of the same vocabulary.

When you need multiple or specialised sitemaps

A single sitemap is limited to 50,000 URLs and 50 MB uncompressed. Larger sets must be split, and a sitemap index can organise the files. Google’s sitemap index guidance covers the structure and requirements.

You can also split smaller sets by content type if that makes maintenance easier. A plugin producing separate post and page sitemaps is not creating a problem simply because the site is small.

Specialised extensions can provide additional information about images, videos, news or alternate language versions. Use them when the content and implementation call for them. Do not add a separate “mobile sitemap” simply because a normal responsive website works on phones, or install extra generators for every media type without checking what the current system already supplies.

A sound discovery setup remains relevant when search results include AI features. Google says a page must be indexed and eligible to appear with a snippet to qualify as a supporting link in AI Overviews or AI Mode. It does not require a special AI text file or special markup for those features. See its AI features documentation.

An XML sitemap can support discovery within that wider process. It does not guarantee selection as an AI citation, and Google’s requirements should not be presented as universal rules for every AI service.

AI can help compare URL lists or explain a parser error, but verify its suggestions against live responses and current documentation. It should not invent modification dates, decide that a useful page must be deleted, or create an extra sitemap solely to make the setup look more advanced.

Keep sitemap maintenance tied to website changes

Review the sitemap when you publish important content, consolidate pages, change URL structures or replace the system that generates it. Check the file, the included URLs and their internal links together.

If sitemap errors are part of wider search performance problems, Maple Web Design’s SEO services in Vancouver address the broader work. The aim is a website whose useful pages can be discovered and understood, with a sitemap that accurately reflects them.

Share with friends