You published new pages. Google hasn’t picked them up.
You open Search Console and see a sitemap that errors out, or no sitemap at all.
Here’s the fix. An XML sitemap is a file that lists the URLs you want search engines to crawl and index. This guide shows you how to create one, check it and submit it, with exact steps.
What an XML sitemap does (and doesn’t do)
Think of it as a list you hand to Google: “These are the pages I care about.”
It helps Google discover URLs, especially on new sites, large sites, or sites with weak internal linking.
It does not:
- Guarantee indexing. Google decides that.
- Boost rankings by itself.
- Fix thin, duplicate or blocked pages.
Honestly, this is where most beginners go wrong. They treat the sitemap as a magic button. It’s a hint, not a command.
What goes inside an XML sitemap
A basic sitemap is a plain text file in XML format. Here is a minimal example. The domain and dates are placeholders (example only):
| Sample sitemap.xml (example) |
|---|
| <?xml version=”1.0″ encoding=”UTF-8″?> |
| <urlset xmlns=”http://www.sitemaps.org/schemas/sitemap/0.9″> |
| <url> |
| <loc>https://www.example.com/</loc> |
| <lastmod>2025-01-15</lastmod> |
| </url> |
| <url> |
| <loc>https://www.example.com/services/seo/</loc> |
| <lastmod>2025-01-10</lastmod> |
| </url> |
| </urlset> |
Quick breakdown of the tags:
| Tag | Required? | What to know |
|---|---|---|
| urlset | Yes | The wrapper for the whole file. |
| url | Yes | One block per page. |
| loc | Yes | The full canonical URL, including https and the exact version (www or non-www). |
| lastmod | Optional | Last real content change. Useful only if it’s accurate. |
| priority, changefreq | Optional | Google says it ignores these. Don’t spend time on them. |
Limits to remember: one sitemap file can hold up to 50,000 URLs or 50 MB uncompressed. Past that, split it into several files and list them in a sitemap index file.
How to create an XML sitemap: 4 methods
1. WordPress with Yoast or Rank Math
Most sites I see use this. Turn on the plugin’s sitemap feature and it generates the file automatically.
- Yoast SEO: usually at /sitemap_index.xml
- Rank Math: usually at /sitemap_index.xml
- WordPress core (no plugin): /wp-sitemap.xml
Open the URL in your browser to confirm it loads. If you run an SEO plugin, disable the core sitemap so you don’t have two competing files.
2. Shopify, Wix, Squarespace and similar platforms
These generate a sitemap for you, usually at /sitemap.xml. You normally can’t edit it directly. Your job is to control what gets in through noindex settings and page visibility.
3. Screaming Frog (good for custom or older sites)
- Crawl your site.
- Go to Sitemaps > XML Sitemap.
- In the config, untick non-200 pages, noindex pages and canonicalised URLs.
- Export, then upload the file to your site’s root folder.
The free version crawls up to 500 URLs, which is plenty for practice sites.
4. Write it by hand
For a small static site, copy the sample above into a text editor, save it as sitemap.xml, and upload it to the root so it loads at https://yourdomain.com/sitemap.xml.
Clean it before you submit it
A sitemap should contain only URLs you want indexed. That means every URL should be:
- Status 200 (not 404, not 301)
- Self-canonical (not pointing to another URL)
- Indexable (no noindex tag)
- Not blocked in robots.txt
Test the status of any suspicious URL with the HTTP Status Checker. If a URL redirects, run it through the Redirect Checker to see where it ends up, then put the final URL in the sitemap instead.
Also check that your robots.txt isn’t blocking pages you listed. The Robots.txt Checker does this quickly.
The mistake I see freshers make
They submit the sitemap exactly as the plugin generated it and call the job done.
On a client site last year, the sitemap was full of URLs that redirected, tag archive pages with almost no content, and a few pages marked noindex. The sitemap was telling Google two opposite things: “index this” and “don’t index this.” Search Console flagged it, and the fresher on the account hadn’t looked at the report.
A sitemap is a statement of intent. If it contradicts your other signals, Google trusts it less. This is one of several habits I cover in SEO mistakes beginners make in their first job.
How to submit an XML sitemap in Google Search Console
Follow these steps exactly:
- Open Google Search Console and select your property (the right one: domain or URL-prefix, https and the correct www version).
- In the left menu, go to Indexing > Sitemaps.
- Under Add a new sitemap, type only the path after your domain, for example sitemap_index.xml or sitemap.xml.
- Click Submit.
- Check the Status column in the “Submitted sitemaps” table.
You’ll see one of these:
| Status | What it means | What to do |
|---|---|---|
| Success | Google fetched and read the file. | Check the discovered URL count looks right. |
| Has errors | The file loaded but some entries have problems. | Click the sitemap to see the error details and fix them. |
| Couldn’t fetch | Google couldn’t retrieve the file. | Open the URL yourself. Check it returns 200, isn’t blocked by robots.txt, and isn’t behind a login. |
“Couldn’t fetch” sometimes shows right after submission and clears on its own. If it stays for a few days, treat it as a real problem.
Add the sitemap to robots.txt too
This is a one-line addition that helps every search engine find your file, not just Google. Add this to your robots.txt (example domain):
| robots.txt (example) |
|---|
| Sitemap: https://www.example.com/sitemap.xml |
Use the full absolute URL. You can list more than one sitemap line if you have several files. If you also care about Bing, submit the same file in Bing Webmaster Tools under Sitemaps.
Check indexing, not just submission
Submitting is step one. The useful part is what happens next.
- Go to Indexing > Pages in Search Console.
- Use the filter at the top and choose All submitted pages.
- Look at the reasons for non-indexed pages, such as “Crawled – currently not indexed” or “Duplicate, Google chose different canonical.”
That filter shows you only pages from your sitemap, so you’re looking at the URLs you said matter. This is where the real SEO work starts. If your important pages sit in “Crawled – currently not indexed,” the problem is usually content quality or internal linking, not the sitemap.
XML sitemap checklist (copy this)
- The sitemap loads in a browser at a clean URL (no login, no redirect).
- It uses the correct protocol and domain version (https, www or non-www, matching your canonical).
- Every URL returns status 200.
- No redirected, 404, noindex or canonicalised URLs are listed.
- No URLs are blocked in robots.txt.
- Thin pages like tag archives, internal search results and parameter URLs are left out.
- lastmod reflects real content changes, not a daily auto-update.
- The file is under 50,000 URLs and 50 MB, or split with a sitemap index.
- The sitemap is referenced in robots.txt.
- It is submitted in Search Console, and the status reads Success.
- You’ve reviewed “All submitted pages” in the Pages report.
Common questions
Do small sites need a sitemap?
If your site is small and well linked, Google can find pages without one. A sitemap is still cheap insurance, and it gives you the “submitted pages” report in Search Console, which is genuinely useful.
How often should I resubmit?
You usually don’t need to. Google re-reads sitemaps it already knows about. Submit once, then fix problems when the report flags them.
Should I include images or videos?
Only if image or video search matters for your business. For most beginners’ projects, a standard page sitemap is enough.
What to do next
Pick a site you can practise on, your own blog or a friend’s business. Build the sitemap, clean it using the checklist, submit it, and read the Pages report a week later. That one exercise teaches you more than a lot of courses do.
To see where sitemaps fit in the bigger picture, read my SEO process framework. If you get stuck on a Search Console error, bring it to the free WhatsApp community and we’ll look at it together.



