XML Sitemap Guide: How to Create and Submit One

Learn what an XML sitemap is, what to include, the 50,000 URL and 50MB limits, how to create one on any platform and how to submit it in Google Search Console.

By Backlink Generator Team · Updated · 6 min read

An XML sitemap is a file that lists the URLs on your website that you want search engines to know about. It does not force Google to index anything, but it is one of the simplest ways to tell Google which pages exist and when they changed. This guide covers what to include, how to create one and how to submit it.

Do you need a sitemap?

Google says a sitemap is especially helpful if your site is large, new with few external links, has many pages that are not well linked internally, or has a lot of rich media. A small site where every page is linked from the menu may be crawled fine without one.

In practice, a sitemap costs almost nothing to set up, and most platforms create one automatically. There is no downside to having a clean one.

What an XML sitemap looks like

A basic sitemap is a list of url entries inside a urlset element. Each entry contains:

  • loc (required): the full, absolute URL of the page, for example https://example.com/services/
  • lastmod (optional): the date the page last changed meaningfully, in W3C date format such as 2026-10-13

The sitemap protocol also defines changefreq and priority. Google has said it ignores both, so you do not need to spend time on them. Google does use lastmod if it is consistently accurate, so only update it when the content actually changes, not on every page load.

What to include and what to leave out

Include only the canonical, indexable version of each page you want in search results.

Include:

  • Pages that return a 200 status
  • The canonical URL (the one in your canonical tag)
  • One consistent version of your domain, either with or without www, and https

Leave out:

  • Redirected URLs and 404 pages
  • Pages with a noindex tag
  • Pages blocked by robots.txt
  • Duplicate versions such as URLs with tracking parameters, filter combinations or session IDs
  • Thank-you pages, login pages, cart and checkout pages, internal search results

A sitemap full of redirects and noindexed pages sends mixed signals and makes your Search Console reports harder to read.

Size limits and sitemap index files

A single sitemap can contain up to 50,000 URLs and must be no larger than 50MB uncompressed. If your site is larger, split it into several sitemaps and list them in a sitemap index file, then submit the index.

Splitting by section also helps with diagnosis even on smaller sites. For example, an online store might use separate sitemaps for products, categories and blog posts, so Search Console shows indexing coverage per section.

How to create a sitemap

WordPress

WordPress has generated a basic sitemap at /wp-sitemap.xml since version 5.5. SEO plugins such as Yoast SEO and Rank Math replace it with their own, usually at /sitemap_index.xml, and let you exclude post types or taxonomies you do not want indexed.

Shopify, Wix, Squarespace and Blogger

These platforms generate a sitemap automatically, usually at /sitemap.xml. You cannot always edit it directly, but it updates as you add pages.

Next.js and other frameworks

Modern frameworks can generate a sitemap from your routes at build time or on request. Next.js, for example, supports a sitemap file in the app directory that returns a list of URLs. Make sure dynamic pages such as blog posts are pulled from your data source, so new pages appear automatically.

Static or hand-built sites

For a small static site, you can write the file by hand or use a crawler-based generator, then upload sitemap.xml to your root folder. Regenerate it whenever you add or remove pages.

How to submit your sitemap

There are two ways to tell Google about your sitemap, and you should do both.

1. Add it to robots.txt

Add a Sitemap line with the full URL anywhere in your robots.txt file:

  • Sitemap: https://example.com/sitemap.xml

Any search engine that reads your robots.txt can then find it. Our robots.txt guide explains the rest of the file.

2. Submit it in Google Search Console

  1. Open Google Search Console and select your property.
  2. Go to Indexing, then Sitemaps.
  3. Enter the sitemap URL and click Submit.
  4. Check the status. "Success" means Google could read it. "Couldn't fetch" or "Has errors" means you need to check the URL, the server response or the file format.

After submission, open the Pages report and filter by your sitemap to see how many submitted URLs are indexed. Bing Webmaster Tools has a similar Sitemaps section, and it can import your sites from Search Console.

Common sitemap mistakes

  • Listing non-canonical URLs. If the sitemap says one URL and the canonical tag says another, Google has to choose, and it may not choose yours.
  • Fake lastmod dates. Setting every page to today's date teaches Google to ignore your lastmod values.
  • Forgetting to update. Static sitemaps that never change miss new pages. Automate it where possible.
  • Blocking the sitemap. Make sure robots.txt or a firewall does not block access to the sitemap URL itself.
  • Expecting instant indexing. Submission tells Google about URLs. It does not guarantee they will be crawled quickly or indexed at all.

A sitemap tells Google what exists on your site. Links from other sites give Google more paths to find those pages and more context about them. For a new website with almost no links, both matter. Discovery backlinks from a tool like Backlink Generator add public mentions of your URL, which can help crawlers find it, though neither sitemaps nor backlinks guarantee indexing. If pages still are not indexed, our guide to fixing Search Console indexing statuses explains each status.

FAQ

How often should I update my sitemap?

Whenever you add, remove or significantly change pages. Most platforms and plugins update it automatically. You do not need to resubmit it in Search Console after every change, because Google rechecks submitted sitemaps periodically.

Does a sitemap improve rankings?

No. A sitemap helps discovery and gives Google useful information such as last modified dates, but it does not make a page rank higher. Content quality, relevance and links do that.

Can I have more than one sitemap?

Yes. Large sites must split sitemaps at 50,000 URLs or 50MB uncompressed, and many sites split by section for easier reporting. List them all in a sitemap index file and submit the index.

START FREE

Create 100 free backlinks now.

Free account, no credit card. See every link in a live log, then export your report.

Open the generator