Skip to content

How do I create a sitemap?

Sitemaps

Check whether you already have one. Most website platforms generate a sitemap automatically, usually at /sitemap.xml; WordPress uses /wp-sitemap.xml. If yours does not, turn one on in your CMS or SEO plugin, have your framework build it when you deploy, or write a short XML file by hand. Then add a Sitemap: line to your robots.txt file and submit the address in Search Console.

Step 1: check whether your platform already makes one

  • WordPress has built a sitemap index at /wp-sitemap.xml since version 5.5, according to the WordPress core announcement. SEO plugins often switch it off and publish their own instead, at a different address.
  • Shopify generates sitemap.xml at the root of every store domain and keeps it up to date with products, collections, pages and blog posts, as its help centre explains.
  • Other hosted builders usually do the same. Google's advice is to search for "[your platform] sitemap" to find where yours lives.

Two quick checks find most existing sitemaps: open https://yourdomain/sitemap.xml in a browser, and look for a Sitemap: line in https://yourdomain/robots.txt.

Step 2: generate one if you have none

Pick the method that matches how your site is built:

  • Built from code or a static site generator: produce the sitemap during the build from the same list of routes that creates your pages, so it can never fall out of date.
  • A site you cannot change programmatically: a crawler-based generator visits your pages and writes the file. Rerun it whenever you add or remove pages.
  • A handful of pages: write it by hand. A sitemap is a plain list:
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
  <url>
    <loc>https://www.example.com/</loc>
  </url>
  <url>
    <loc>https://www.example.com/services/garden-design</loc>
    <lastmod>2026-10-02</lastmod>
  </url>
</urlset>

A plain text file with one full URL per line also works if you only need to list pages.

Step 3: follow Google's format rules

Google's guide to building a sitemap sets the limits:

  • Save the file as UTF-8 and use full, absolute URLs, in the canonical form you want shown in results.
  • Keep each file under 50,000 URLs and 50 MB uncompressed. For more, split the list and point to the parts from a sitemap index:
<?xml version="1.0" encoding="UTF-8"?>
<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
  <sitemap><loc>https://www.example.com/sitemaps/products.xml</loc></sitemap>
  <sitemap><loc>https://www.example.com/sitemaps/articles.xml</loc></sitemap>
</sitemapindex>
  • Fill in <lastmod> only with the date of a real content change. Google ignores <priority> and <changefreq>, so you can leave them out.
  • Host it at the root of the site. A sitemap that is not submitted in Search Console only covers URLs in its own folder and below.

Step 4: tell search engines where it is

Add one line anywhere in robots.txt; Google picks it up the next time it reads the file, and other major search engines read it too:

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

Then submit the same address in the Search Console Sitemaps report, which also shows whether Google could read it. How do I submit a sitemap? walks through that step, and What is a sitemap and why do I need one? covers whether you need one at all.

How AutoPSEO helps

AutoPSEO's Sitemaps page lists the sitemaps Search Console holds for your property, with their warnings, errors and last download date, and with full access it can submit several new sitemap URLs at once. To check what you just built, bulk-inspect the URLs in the new sitemap, up to 500 per run (URL Inspection), and confirm each page is indexable.

Put your SEO content on autopilot

Connect Search Console and your site. AutoPSEO scans it and plans the first topics right away. No credit card needed.