An XML sitemap is a file that lists the pages you want search engines to know about. It does not guarantee indexing, and it is no substitute for good internal links, but it helps search engines discover new and updated pages sooner. This tutorial shows how to create one, check it and submit it.
What a sitemap contains
A sitemap is a list of addresses in a standard XML format. Each entry holds the page address and, optionally, the date it was last modified. Large sites split the list into several files joined by a sitemap index. A single sitemap file may hold up to 50,000 addresses.
A minimal sitemap 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/</loc>
<lastmod>2026-10-01</lastmod>
</url>
</urlset>
Step 1: Find out whether you already have one
Most platforms generate a sitemap automatically, so check before creating anything.
- WordPress without an SEO plugin: open yourdomain/wp-sitemap.xml.
- WordPress with an SEO plugin: open yourdomain/sitemap_index.xml. The plugin replaces the built-in version.
- Hosted website builders and shop platforms: usually yourdomain/sitemap.xml.
If a list of addresses appears, you already have a sitemap and can move to Step 3.
Step 2: Create one if it is missing
- On WordPress, install a well-maintained SEO plugin and switch on its sitemap feature, or simply rely on the built-in sitemap.
- On a static or custom site, use a sitemap generator that crawls the site and produces the file, then upload it to the site root. Regenerate it whenever pages are added or removed, or ask your developer to generate it automatically.
Step 3: Decide what belongs in it
A sitemap should list only pages you want in search results.
Include:
- Pages and posts that are published and useful to visitors
- Product and category pages that have real content
Exclude:
- Pages set to noindex
- Addresses that redirect or return an error
- Thank-you pages, internal search results, login pages
- Thin tag or author archives you do not want indexed
In an SEO plugin, this is controlled by switching content types on or off in the sitemap settings.
Step 4: Check the file
- Open the sitemap in a browser. It should load without an error.
- Click a few of the listed addresses. Each should open a working page.
- Confirm the addresses use https and your preferred www or non-www form.
- Look for pages that should not be there, such as test pages.
- Check that the modification dates look real. A date that changes on every page every day is ignored by search engines.
Step 5: Reference it in robots.txt
Add one line to your robots.txt file so any crawler can find the sitemap:
Sitemap: https://www.example.com/sitemap_index.xml
Many SEO plugins add this line automatically. See How to Create a Robots.txt File Without Blocking Important Pages.
Step 6: Submit it
- Open Google Search Console and choose your property. If you have not set it up, follow How to Set Up Google Search Console for a New Website.
- Open Sitemaps in the menu.
- Enter the sitemap address and submit.
- Wait for the status to show Success and note the number of discovered pages.
Bing Webmaster Tools has an equivalent Sitemaps section. Submitting there covers the other major search engine.
You only need to submit once. Search engines fetch the file again on their own.
Step 7: Monitor
- Compare the number of discovered pages with what you expect.
- In the Page indexing report, filter by your sitemap to see which submitted pages are not indexed, and why.
- If the status shows an error such as could not fetch, open the address yourself and check that it is not blocked by robots.txt, a login or a coming-soon mode.
Common mistakes
- Submitting a sitemap while the site still blocks search engines.
- Listing redirected, noindex or deleted pages.
- Running two plugins that both generate sitemaps.
- Using http addresses on an https site.
- Expecting a sitemap to get poor or duplicate pages indexed.
Next step
A sitemap helps discovery. To understand what happens after a page is found, read Technical SEO Basics: Crawling, Indexing and Ranking Explained.
