Free tools that run in your browser. Use any tool without an account.

Favourites Cart
Sign in
Join free
SEO and Marketing

XML Sitemap Guide: Create and Submit One

By FreeToolr editors4 November 20267 min read
XML sitemap file showing canonical website URLs and last modification dates on a computer screen

An XML sitemap lists the pages you want search engines to discover. It can help crawling and indexing, but it cannot force a search engine to index a page or improve its ranking.

Most new, large, frequently updated, ecommerce, media, and international websites should have one. Small sites with strong internal links may manage without one, but creating a clean sitemap still gives search engines a useful discovery signal.

What is an XML sitemap?

An XML sitemap is a machine-readable file containing URLs from your website. It can also include metadata, such as the date a page last changed in a meaningful way.

A typical file looks like this:

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

The <loc> element contains the full page URL. The <lastmod> element records a meaningful content change. Do not update it only because your sitemap file was regenerated.

An XML sitemap is different from an HTML sitemap. XML is mainly for search engines, while HTML helps people browse your website.

What an XML sitemap does and does not do

A sitemap helps search engines find URLs that might otherwise take longer to discover. It can also provide a freshness signal through accurate <lastmod> values.

It does not replace internal links. Your important pages should remain reachable through normal, crawlable links from other pages.

It also does not guarantee crawling, indexing, or ranking. Google describes a submitted sitemap as a hint. Google may crawl some listed URLs, ignore others, or index none of them.

A sitemap cannot fix these problems:

  1. A page blocked by robots.txt.
  2. A page with a noindex directive.
  3. A page that returns a 404 or 410 status.
  4. A page with poor content or a wrong canonical URL.
  5. A website with broken internal links.
Advertisement

Do you need an XML sitemap?

Google says a sitemap may not be necessary for a small website with about 500 pages or fewer, strong internal linking, and little rich media.

A sitemap is still useful for many small websites. It becomes more valuable when your site has one or more of these conditions:

  1. It launched recently and has few external links.
  2. It contains thousands of pages.
  3. It publishes content often.
  4. It has products, filters, or large archives.
  5. Some pages are several clicks from the homepage.
  6. It uses JavaScript to display or load content.
  7. It serves several languages or countries.
  8. It contains images, videos, or news content.

New websites and large ecommerce stores usually benefit the most. A sitemap does not make orphan pages healthy. Add internal links to important pages as well.

Find your existing sitemap first

Your CMS may already create a sitemap. Check these common locations:

  1. https://example.com/sitemap.xml
  2. https://example.com/sitemap_index.xml
  3. https://example.com/wp-sitemap.xml for WordPress core

You can also check your CMS settings, the robots.txt file, or Google Search Console.

Do not create a second sitemap before checking. Two files can contain conflicting URL sets and make maintenance harder.

How to create an XML sitemap

Option 1: Use your CMS

Many content management systems create and update sitemaps automatically.

WordPress core has generated XML sitemaps since version 5.5. A plugin may provide extra controls, such as excluding selected post types or taxonomies.

Shopify generally creates a sitemap automatically. Wix, Squarespace, Drupal, and Joomla also provide built-in or extension-based options. Check the actual file before submitting it.

Option 2: Generate one with FreeToolr

For a small or medium website, use the FreeToolr XML Sitemap Generator. Enter your website details, review the output, and check that the URLs match your preferred domain version.

A generator can create the file, but you still need to inspect the results. Remove test pages, redirects, duplicate URLs, and pages that should not appear in search.

Option 3: Generate one from your database

Large or custom websites should generate sitemaps from the same database that stores published URLs. Set rules that include only live, canonical, indexable pages.

Regenerate the file when pages are published, deleted, redirected, or meaningfully changed. Store the sitemap at a stable URL so search engines can revisit it.

Option 4: Create one manually

Manual creation works for a small, stable website. Use full URLs, valid XML, and the correct namespace.

You can check the file with the FreeToolr XML Formatter. It can make the structure easier to read and help reveal malformed XML.

What to include

Include URLs that meet all or most of these conditions:

  1. They use your preferred HTTPS version.
  2. They return a 200 status code.
  3. They are canonical URLs.
  4. They are indexable.
  5. They contain useful content.
  6. They are intended for search results.
  7. They belong to the site or subdomain covered by the sitemap.

For an online shop, include canonical product and category pages. For a blog, include published posts and useful category pages. For a service site, include live service and location pages that offer distinct value.

Do not include every URL your server can produce. A larger file is not automatically better.

What to exclude

Keep these URLs out of your sitemap:

  1. Redirects, including 301 and 302 URLs.
  2. 404 and 410 error pages.
  3. Pages with noindex directives.
  4. URLs blocked by robots.txt.
  5. Duplicate pages and non-canonical versions.
  6. Internal search result pages.
  7. Cart, checkout, login, and account pages.
  8. Tracking and filter parameters.
  9. Empty category pages.
  10. Temporary, test, or staging URLs.

A common ecommerce problem involves filtered URLs. A URL such as example.com/shoes?size=10&colour=red may create many combinations. Include it only if it is a stable, useful, canonical landing page.

Sitemap limits and sitemap indexes

One sitemap can contain up to 50,000 URLs or 50 MB of uncompressed data, whichever limit comes first. Larger sites must split their URLs across several sitemap files.

A sitemap index lists those separate files. For example, an online store might use:

<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
 <sitemap>
 <loc>https://example.com/products-sitemap.xml</loc>
 </sitemap>
 <sitemap>
 <loc>https://example.com/categories-sitemap.xml</loc>
 </sitemap>
</sitemapindex>

You can split files by content type, publication year, country, or update frequency. Keep each file within the limits and list the index file in Search Console.

Worked example with real numbers

Imagine a store has 62,400 product URLs. A sitemap cannot hold all of them because the limit is 50,000 URLs.

Create two files instead:

  1. products-1.xml with 31,200 URLs.
  2. products-2.xml with 31,200 URLs.

Then create sitemap_index.xml with two entries. The index contains two sitemap references, not 62,400 product entries.

Before submission, check that every product URL returns 200, uses HTTPS, and matches its canonical tag. Remove discontinued products that redirect or return an error.

Use metadata correctly

The main useful optional field is <lastmod>. Use the date or date and time of the last meaningful page change.

A meaningful change could include updated pricing, a revised guide, a changed product description, or a new section. Do not change the date for minor design edits or a routine sitemap rebuild.

Google ignores <priority> and <changefreq>. You can leave them out. They do not tell Google which pages to rank first or how often to crawl them.

Submit your sitemap to Google and Bing

Google Search Console

  1. Verify your website property in Google Search Console.
  2. Open the Sitemaps report.
  3. Enter the sitemap path or full sitemap index URL.
  4. Select Submit.
  5. Review the status and discovered URL information later.

You can submit the sitemap index instead of each child sitemap. Google can revisit a submitted file automatically. Repeated manual submissions are usually unnecessary.

Bing Webmaster Tools

Verify your website in Bing Webmaster Tools. Open the Sitemaps section and submit the XML sitemap or sitemap index URL.

Bing also supports sitemap discovery through robots.txt. Add this line:

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

Use the full HTTPS URL. You may reference more than one sitemap line when your site uses separate files.

International and multilingual websites

For US, UK, European, Nigerian, and Gulf audiences, use clear URL and language structures. Examples include /en-us/, /en-gb/, /fr-fr/, /en-ng/, /ar-ae/, and /ar-sa/.

Only include a regional URL if it has useful, indexable content. Different currencies, delivery rules, contact details, or legal information may justify separate pages.

Use hreflang annotations to connect equivalent language and regional versions. Keep the sitemap URL set consistent with your canonical and hreflang setup.

Do not create thin regional pages that differ only by a currency symbol. Search engines may treat near-identical versions as duplicates.

Special sitemap types

Image, video, and news sitemap features can describe certain media content. They are most useful for websites where that content matters in search.

A news sitemap is not a general shortcut for faster indexing. Use it only for recent news content that meets Google News requirements.

RSS or Atom feeds can also help search engines find recent content. They do not replace a complete sitemap when your site has a large archive.

Check and maintain your sitemap

Review your sitemap after major site changes and at regular intervals. A simple audit should check:

  1. The file opens publicly without a login.
  2. The XML is valid and uses UTF-8 encoding.
  3. Every URL is absolute and uses HTTPS.
  4. URLs return the expected status code.
  5. Canonical tags match the sitemap URLs.
  6. Noindex and blocked pages are absent.
  7. Deleted pages and redirects are removed.
  8. <lastmod> values reflect real changes.
  9. The sitemap stays within size limits.
  10. Search Console and Bing show no processing errors.

A sitemap problem often signals a wider technical issue. For example, thousands of redirected URLs may show that your CMS creates outdated links or weak canonical rules.

Sources

  1. Google Search Central: Learn about sitemaps
  2. Google Search Central: Build and submit a sitemap
  3. Google Search Central: Sitemap FAQ
  4. Sitemaps.org protocol
  5. Bing Webmaster Tools: Sitemaps
  6. [WordPress Developer Resources: XML sitemaps](https://developer.wordpress.org/apis/handbook/s XML-sitemaps/)

Questions people ask

Does an XML sitemap improve Google rankings?

No. Google does not treat a sitemap as a direct ranking factor. It can help Google discover and recrawl URLs, but it does not guarantee indexing or higher rankings.

How many URLs can an XML sitemap contain?

One sitemap can contain up to 50,000 URLs or 50 MB of uncompressed data. Use a sitemap index when your website exceeds either limit.

Should a sitemap include noindex pages?

No. Include only canonical, indexable URLs that you want search engines to consider. Remove noindex pages, redirects, errors, duplicates, and blocked URLs.

Does WordPress create an XML sitemap automatically?

Yes. WordPress core has generated XML sitemaps since version 5.5. Check `/wp-sitemap.xml`, then review the output for unwanted post types or taxonomies.

Do I need to submit my sitemap to Google and Bing?

Submission is not required, but it gives each search engine a direct discovery signal. Submit the sitemap index in Google Search Console and Bing Webmaster Tools, and reference it in `robots.txt`.

FreeToolr articles are written and checked by our editors. Found a mistake? Email [email protected]. Read our editorial policy.

More in SEO and Marketing

Help keep every tool free

FreeToolr stays free because people help it grow. Share a tool you like, tell us what to build next, or support us on Ko-fi.

Advertisement
Advertisement