Search Engine Basics

What Is an XML Sitemap? How to Create and Submit One

An XML sitemap is a file that lists the important pages on your website, so search engines can find them faster. This guide shows what a sitemap looks like. It also explains when your site needs one. The last part walks you through creating the file before you submit it to Google or Bing.

Updated 26 Oct 20269 min readChecked against sitemaps.org
Quick answer

An XML sitemap is a list of page addresses written in a format search engines can read. It usually lives at a URL like example.com/sitemap.xml. It helps crawlers discover new or updated pages, although it does not guarantee that every listed page gets indexed.

Usman AliWritten by Usman AliGrowth and SEO specialist · 7 years in SEO
Amir ShahidReviewed by Amir ShahidSenior SEO strategist · 9+ years in SEO

The basics

What Is an XML Sitemap, in Plain Words

An XML sitemap lists the URLs you want search engines to crawl. It can also show when each page last changed.

Search engines mostly find pages by following links, as our guide to crawling explains. That works well for pages with plenty of links pointing to them. It works badly for a brand new page, or a page buried five clicks deep.

A sitemap fixes that gap by handing crawlers a full list of your pages. It is a plain file, written in a format called XML, that lists each page address. It can also say when each page last changed. Crawlers such as Googlebot read the file before adding any new addresses to their crawl queue. Our beginner’s guide to search engines shows where sitemaps fit among the other stages of search.

XML sitemap

Written for search engines

It is a machine-readable file that lists your URLs. Visitors never see it, while crawlers use it to discover pages quickly.

HTML sitemap

Written for people

A normal web page full of links that helps visitors find their way. It can help crawlers a little, but it is not the same tool.

Look inside

XML Sitemap Example, Line by Line

A valid sitemap needs only a urlset wrapper plus one loc tag for each page. Here is a sitemap with two pages.

<?xml version="1.0" encoding="UTF-8"?> <urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"> <url> <loc>https://example.com/</loc> <lastmod>2026-10-20</lastmod> </url> <url> <loc>https://example.com/blog/first-post/</loc> <lastmod>2026-10-24</lastmod> </url> </urlset>
TagWhat it holdsDoes Google use it?
locThe full address of the page, including httpsYes, it is required
lastmodThe date the page content last changedYes, if the dates are honest
changefreqHow often the page might changeNo, Google ignores it
priorityHow important the page is, from 0.0 to 1.0No, Google ignores it

Google has said clearly that it skips the changefreq or priority values, so you can safely leave them out. Focus on accurate lastmod dates instead, because Google trusts them only when they match real changes.

Is it worth it?

Do You Need an XML Sitemap?

You need a sitemap most when your site is large or brand new. It also helps a lot when few pages link to each other.

Large sites

Shops or news sites with thousands of pages. Crawlers may miss deep pages without a full list to follow, especially when crawl budget is tight.

Strongly recommended

New sites

A fresh site has few links from other websites. A sitemap gives crawlers a way in before those links exist.

Strongly recommended

Small, well-linked sites

A ten-page site with a clear menu gets crawled fine without one. Adding a sitemap still does no harm.

Nice to have

Sites with lots of images or videos also gain from special sitemap types. News publishers get a sitemap type of their own as well. Those types are covered in the next section.

Know the formats

Types of Sitemaps and Their Limits

The standard page sitemap covers most needs. These extra types help with bigger or richer sites.

TypeWhat it listsBest for
Page sitemapNormal web page addressesEvery website
Sitemap indexA list of other sitemap filesSites with more than 50,000 URLs
Image sitemapImages found on each pagePhoto sites, shops or portfolios
Video sitemapVideo details such as title and lengthSites that host their own videos
News sitemapArticles from the last two daysPublishers in Google News

Each sitemap file can hold up to 50,000 URLs. It must also stay under 50 MB before compression. Bigger sites split their pages across several files. One sitemap index file then lists all of those smaller sitemaps. Many SEO plugins do this for you, which is why WordPress sites often show a file called sitemap_index.xml.

Older guides sometimes mention mobile sitemaps, which were built for feature phone pages and are no longer needed for modern responsive sites.

Build it

How to Create an XML Sitemap

You rarely need to write a sitemap by hand. Pick the route that matches how your site is built.

01WordPress coreSince version 5.5, WordPress makes a basic sitemap at /wp-sitemap.xml with no setup.
02SEO pluginMost SEO plugins build a cleaner sitemap index that updates with every post.
03Other platformsMost hosted builders, such as Shopify, create a sitemap for you at /sitemap.xml.
04By handFor a tiny static site, you can write the XML yourself before uploading it to the root folder.

Plugins or platforms produce a dynamic sitemap that updates itself, while a static sitemap made with an online sitemap generator must be rebuilt whenever pages change. Whichever route you choose, open the sitemap in your browser once it is live. You should see a clean list of your real pages. You may spot pages that should not be in search, such as test pages or old redirects. Change your plugin settings to leave those pages out.

Step by step

How to Submit a Sitemap to Google and Bing

Search engines can find your sitemap on their own. Submitting it still helps, because you get reports on what was read.

  1. Copy the full address of your sitemap, such as https://example.com/sitemap_index.xml.
  2. In Google Search Console, open Sitemaps from the left menu.
  3. Paste the sitemap address into the box before you press Submit.
  4. After a day or two, check that the status column says Success.
  5. In Bing Webmaster Tools, submit the same address from the Sitemaps section.
  6. Add a Sitemap line to your robots.txt file, so every crawler can find it.

The Sitemap line is covered in our robots.txt guide. Bing also supports IndexNow, a fast way to tell it about new or changed pages the moment you publish.

The Sitemaps report shows how many URLs Google discovered. To see which of them actually made it into the index, use the page indexing report described in our guide to checking if a page is indexed.

After you submit

Reading the Sitemaps Report After You Submit

Once Google has read your file, the Sitemaps report in Search Console shows how it went, as long as you read the numbers the right way.

Before any of this works, you need to verify site ownership in Search Console, usually through a DNS record or an HTML file uploaded to your server. Bing Webmaster Tools asks for the same proof, although it can also import a site you have already verified with Google.

Discovered

How many URLs Google read

The Discovered pages column counts the URLs Google found in your file. It should roughly match the number of pages you meant to list.

Indexed

How many made it into the index

Click a sitemap, then choose See page indexing to compare indexed URLs with those left out. That filtered view covers only the URLs listed in that one file.

A gap between submitted and indexed pages is normal, so a handful of missing URLs is no reason to worry. A large gap usually points to weak, duplicate or noindex pages in the file. On a new site, it can also mean Google simply has not finished crawling yet. The reason shown beside each excluded URL tells you which of these problems you are facing.

Real-world case

Why Google Retired the Sitemap Ping

Case study

When a handy shortcut became mostly spam

For years, site owners could ping Google whenever a sitemap changed. You simply opened a special web address with your sitemap URL attached. Many plugins did this automatically after every update.

  • 2005Google launches the Sitemaps protocol to help crawlers find pages.
  • 2006Yahoo and Microsoft join Google at sitemaps.org, so one format works everywhere.
  • June 2023Google announces it will retire the sitemap ping. Its research found most unauthenticated pings were not useful.
  • Late 2023The old ping address stops working for good. Google relies on Search Console, robots.txt sitemap lines and accurate lastmod dates instead.

The same announcement stressed one more point. Google only trusts lastmod dates when they match real content changes. Some sites updated every date daily to look fresh, so Google learned to ignore them.

Lesson: submit your sitemap once in Search Console. After that, keep lastmod dates honest so crawlers can handle the rest.

Do it right

XML Sitemap Best Practices and Common Errors

Follow these rules so search engines can read your sitemap without errors.

  • Use absolute URLs. Write every address in full, starting with https. Also use the right www or non-www version.
  • Save it as UTF-8. Special characters such as the ampersand must be escaped, so they do not break the XML.
  • Compress big files. You can gzip a sitemap, for example sitemap.xml.gz. The 50 MB limit still applies before compression.
  • Add hreflang for other languages. A sitemap can list each language version of a page with xhtml:link entries.
  • Feeds work too. Google also accepts RSS or Atom feeds as sitemaps, which suits blogs that publish often.
  • Fix orphan pages. A page listed in the sitemap with no internal links pointing to it is an orphan page. Add a link to it from related content on your site.
Search Console errorWhat it meansHow to fix it
Couldn’t fetchGoogle could not download the fileCheck the address, robots.txt rules or server errors
Sitemap could not be readThe XML format is brokenRun the file through an XML validator
URL not allowedListed URLs belong to another domain or protocolList only URLs from the same property
Sitemap is HTMLThe address returns a web page, not XMLSubmit the real .xml file

Avoid these

Common Sitemap Mistakes to Fix Today

A sitemap should be a clean list of pages you want in search. The errors below send mixed signals to search engines.

MistakeWhy it hurtsThe fix
Listing noindex pagesYou ask Google to crawl a page, then tell it not to index itRemove noindex pages from the sitemap
Listing redirects or 404sCrawlers waste visits on addresses that lead nowhereList only final URLs that return 200
Non-canonical URLsDuplicate versions confuse which page should rankList the canonical version only
Fake lastmod datesGoogle stops trusting your dates entirelyChange lastmod only when content changes
Blocked in robots.txtGoogle cannot crawl the pages you just listedKeep listed pages open to crawlers

A quick monthly look at the Sitemaps report catches most of these. Any error there links straight to the problem URLs.

FAQ

Questions About XML Sitemaps

Where do I find my sitemap?

Start by trying example.com/sitemap.xml or example.com/sitemap_index.xml in your browser. On WordPress without an SEO plugin, the core sitemap sits at example.com/wp-sitemap.xml. Your robots.txt file may also list it on a Sitemap line.

Does a sitemap help my rankings?

A sitemap does not boost rankings directly. It helps search engines find your pages, which is the first step toward ranking. The ranking itself depends on many other factors, with content quality and links near the top.

How many URLs can one sitemap hold?

One sitemap can hold up to 50,000 URLs, with a size limit of 50 MB before compression. Bigger sites split their URLs across several sitemaps. A sitemap index file then points to each one.

Should every page be in my sitemap?

No, you should only include pages you want in search results. Redirects and error pages should stay out of the file. The same goes for noindex pages or duplicate URLs.

How often should I update my sitemap?

Your sitemap should update whenever a page is published or removed. Edits to an existing page should update its lastmod date too. Most CMS tools and SEO plugins do this automatically, so you rarely need to touch it.

Do XML sitemaps matter for AI search?

They matter indirectly, because AI answers in Google or Bing draw on the same search index that sitemaps help to fill. A page that gets discovered sooner can be cited sooner, although a sitemap never guarantees a mention in an AI answer.

Wrapping up

Final Thoughts on XML Sitemaps

An XML sitemap is one of the easiest wins in SEO. It takes a few minutes to set up. Once it is in place, it quietly helps search engines find every page you publish. For most sites, a good plugin or the platform itself does all the work.

Your job is to keep the list clean. Include only real pages you want people to find. Redirects should stay out of the file, as should any page marked noindex. Keep the lastmod dates honest, so search engines keep trusting them. Submit the sitemap once in Google Search Console and Bing Webmaster Tools. It also helps to add a Sitemap line to your robots.txt file. After that, a short check each month is all it needs. A clean sitemap will not lift your rankings on its own, yet it makes sure your best pages never go unnoticed.

Scroll to Top