An XML sitemap is a file that lists the pages you want search engines to find, usually at yoursite.com/sitemap.xml. Here is how to create an XML sitemap in short: list each page's full address inside a loc tag, save the file as UTF-8, upload it to your site's main folder, then add it to robots.txt and Google Search Console.

The Website SEO Checkup warns you when it cannot find a sitemap. This guide shows what the file looks like, how to make one on any kind of site, and how to check that Google can read it.

What is an XML sitemap?

Search engines find pages by following links. A crawler, the robot that visits pages for a search engine, starts on one page and follows links to the next. If a page has few links pointing to it, the crawler may miss it or find it late.

A sitemap gives the crawler a direct list. XML is just a simple text format with tags, a bit like HTML. The sitemap does not make Google index your pages. Google calls a sitemap a hint, not a promise. It still helps new pages get found sooner, and it is the first thing to fix on a new site.

I know the limits of that hint first-hand. Many of my old pages stayed out of Google for years, even with a sitemap and internal links. Some new posts got indexed fast. A sitemap helps Google find pages. It cannot make Google like them.

What does a sitemap file look like?

Here is a small sitemap with two pages. Each line goes into a plain text file called sitemap.xml:

  • <?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-09-01</lastmod></url>
  • <url><loc>https://example.com/about.php</loc></url>
  • </urlset>

Only three tags are required: urlset around everything, url for each page, and loc for the page address. The lastmod tag is the date of the last real change. Google uses it only when your dates are correct, so do not update it for tiny edits like a new copyright year.

You may see priority and changefreq tags in old guides. Google ignores both, so you can leave them out.

Do you need to type this by hand? No. Most sites use a plugin or a generator, as the steps below show. It still helps to know what the file looks like. When something goes wrong, you can open it in a browser and spot a missing page or a wrong address in seconds.

Which pages should go in your sitemap?

List only the pages you want people to find in Google. A good rule: if you would not want a visitor to land on it from search, leave it out.

Put inLeave out
Home page, posts, guidesLogin, cart and admin pages
Main category pagesPages with a noindex tag
Product and service pagesPages that redirect or show a 404 error
The one main address of each pageCopies with ?sort= or tracking codes

Use the full address with https:// and your chosen www or non-www version. Google says relative paths such as /about.php do not work. The address must also be the canonical one, the main address you want shown in search.

How to create an XML sitemap step by step

Pick the method that matches your site:

  1. Bloghints CMS: it builds /sitemap.xml for you and updates it each time you publish. Skip to the robots.txt step.
  2. WordPress: WordPress has a built-in sitemap at /wp-sitemap.xml. Most SEO plugins replace it with their own, often at /sitemap_index.xml. Use only one of them.
  3. Simple PHP or HTML site: paste your page addresses into the free XML Sitemap Generator. It writes the file for you. Save it as sitemap.xml.
  4. Upload the file to your site's main folder. On cPanel hosting, that is usually public_html. Open File Manager, go to public_html and upload it there.
  5. Open yoursite.com/sitemap.xml in a browser. You should see your list of addresses, not an error page.

Keep the file in the main folder. The sitemaps.org rules say a sitemap can only list pages in its own folder and below. A file inside /blog/ cannot list your home page.

If your address has an ampersand (&), write it as &amp; inside the sitemap. A bare ampersand breaks the file.

How big can a sitemap be?

One sitemap can hold up to 50,000 addresses or 50 MB, before compression. Most small sites never come close. If yours is bigger, split it into several files and list them in a sitemap index file. Plugins do this for you.

How do you tell Google about your sitemap?

Do both of these:

  1. Add it to robots.txt. Robots.txt is the file in your main folder that gives rules to crawlers. Add this line anywhere in it: Sitemap: https://example.com/sitemap.xml. The Robots.txt Generator can write the whole file, and our guide to robots.txt for beginners explains each rule.
  2. Submit it in Search Console. Open Google Search Console, choose Sitemaps in the menu, type sitemap.xml and press Submit.

After Google reads the file, the Sitemaps report shows "Success" and how many pages Google found. If it shows "Couldn't fetch" or errors, open the file again and check for a typo, a wrong address or a page that blocks Google.

To see whether one page made it into Google, use URL Inspection. Our guide on how to check if a page is indexed walks you through it.

Now you know how to create an XML sitemap, upload it and hand it to Google. Once the file is live, re-run the free Website SEO Checkup to confirm the sitemap check passes.

Frequently asked questions

Do I need a sitemap for a small site?

It is not required, and Google can find a small, well-linked site without one. Still, it takes a few minutes to make and helps new pages get found sooner. It also gives you a useful report in Search Console.

How often should I update my sitemap?

Update it each time you add, move or delete a page. WordPress plugins and the Bloghints CMS do this by themselves. On a hand-made site, regenerate the file after each new page and upload it again.

Why does Search Console say some sitemap pages are not indexed?

A sitemap only tells Google that a page exists. Google still decides whether to index it, based on quality, duplicates and crawl time. Check those pages with URL Inspection and improve the content or the internal links.