Skip to main content

XML Sitemaps Explained: Help Google Find Your Pages

6 min read

6 min read

XML Sitemaps Explained: Help Google Find Your Pages

Reading time: 6 minutes

An XML sitemap is a file listing all your pages for search engines. If your Scan report flags “Missing sitemap (CRITICAL)”, you’re making Google work too hard to find your content.

TLDR

XML sitemaps tell Google which pages exist on your site and when they were last updated. Without a sitemap, Google finds pages by following links. Orphan pages never get discovered and new content takes weeks to index. With a sitemap, new content gets indexed in days instead of months. WordPress and Shopify auto-generate sitemaps. Submit yours to Google Search Console and add it to your robots.txt file. Only include indexable pages and keep it under 50,000 URLs.

What Is a Sitemap?

Think of it as a directory for search engines:

<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
  <url>
    <loc>https://yoursite.com/</loc>
    <lastmod>2025-11-09</lastmod>
    <priority>1.0</priority>
  </url>
  <url>
    <loc>https://yoursite.com/about</loc>
    <lastmod>2025-11-01</lastmod>
    <priority>0.8</priority>
  </url>
</urlset>

What it tells Google:

  • Which pages exist
  • When each was last updated
  • How important each page is (priority)

Why You Need One

Without a sitemap:

  • Google finds pages by following links
  • Orphan pages (no links to them) = never discovered
  • New pages take weeks/months to get indexed

With a sitemap:

  • Google knows all your pages instantly
  • New content gets indexed in days, not months
  • You control which pages get crawled first

Real impact: Sites that add sitemaps see 30-50% more pages indexed within 30 days.

Creating Your Sitemap

Option 1: CMS Auto-Generation (Easiest)

WordPress:

  • Install “Yoast SEO” or “Rank Math” (free)
  • Settings → XML Sitemaps → Enable
  • Your sitemap appears at: yoursite.com/sitemap.xml

Shopify:

  • Auto-generated by default
  • Located at: yoursite.com/sitemap.xml
  • No setup needed

Squarespace:

  • Settings → Marketing → SEO
  • Check “Auto-generate sitemap”
  • Located at: yoursite.com/sitemap.xml

Option 2: Online Generator (For Small Sites)

If you have <500 pages:

  1. Use https://www.xml-sitemaps.com/
  2. Enter your homepage URL
  3. Click “Start”
  4. Download sitemap.xml
  5. Upload to your website root directory

Option 3: Manual (For Custom Sites)

Create sitemap.xml in your root directory:

<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
  <url>
    <loc>https://help.surmado.com/</loc>
    <lastmod>2025-11-09</lastmod>
    <changefreq>daily</changefreq>
    <priority>1.0</priority>
  </url>
  <url>
    <loc>https://help.surmado.com/docs/getting-started</loc>
    <lastmod>2025-11-05</lastmod>
    <changefreq>weekly</changefreq>
    <priority>0.8</priority>
  </url>
</urlset>

Priority guide:

  • Homepage: 1.0
  • Main sections: 0.8
  • Regular pages: 0.6
  • Blog posts: 0.4

Submitting to Google

Step 1: Verify sitemap exists

Visit https://yoursite.com/sitemap.xml in browser. You should see XML code.

Step 2: Add to robots.txt

Create/edit robots.txt in your root directory:

User-agent: *
Allow: /

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

Step 3: Submit to Google Search Console

  1. Go to search.google.com/search-console
  2. Select your property
  3. Sitemaps (left sidebar)
  4. Enter: sitemap.xml
  5. Click “Submit”

Google will now:

  • Crawl your sitemap within 24-48 hours
  • Index new pages within 3-7 days
  • Re-crawl when you update sitemap

Sitemap Best Practices

1. Only Include Indexable Pages

Don’t include:

  • Thank you pages
  • Admin pages
  • Duplicate content
  • Pages with noindex tag

Do include:

  • All public pages
  • Blog posts
  • Product pages
  • Service pages

2. Keep It Under 50,000 URLs

If you have more pages, create multiple sitemaps:

<!-- sitemap-index.xml -->
<?xml version="1.0" encoding="UTF-8"?>
<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
  <sitemap>
    <loc>https://yoursite.com/sitemap-pages.xml</loc>
  </sitemap>
  <sitemap>
    <loc>https://yoursite.com/sitemap-posts.xml</loc>
  </sitemap>
</sitemapindex>

3. Update Regularly

When to update your sitemap:

  • Added new pages → update immediately
  • Updated content → change <lastmod> date
  • Deleted pages → remove from sitemap

Auto-update: Most CMS plugins (Yoast, Rank Math) auto-update on publish. No manual work needed.

4. Use HTTPS URLs

Wrong: http://yoursite.com/page Right: https://yoursite.com/page

Google prefers HTTPS. Don’t list HTTP URLs if your site is HTTPS.

Common Sitemap Errors

Error 1: “Sitemap is an HTML page”

Your sitemap URL returns a webpage, not XML.

Fix: Ensure sitemap.xml is actual XML file, not HTML page.

Error 2: “Sitemap contains URLs not on this site”

You listed pages from other domains.

Fix: Only include URLs from your own domain.

Error 3: “Couldn’t fetch sitemap”

Google can’t access your sitemap.

Fix:

  • Check sitemap.xml exists at root: yoursite.com/sitemap.xml
  • Verify robots.txt doesn’t block it
  • Check file permissions (should be readable)

Testing Your Sitemap

Validate XML:

Check indexing:

site:yoursite.com

Search this in Google. Number of results = pages Google indexed.

Compare to your sitemap count:

  • Sitemap: 50 pages
  • Google: 12 indexed
  • Gap: 38 pages need attention

Image and Video Sitemaps

If you have lots of images:

Add image tags to your sitemap:

<url>
  <loc>https://yoursite.com/gallery</loc>
  <image:image>
    <image:loc>https://yoursite.com/images/photo1.jpg</image:loc>
    <image:caption>Dallas skyline at sunset</image:caption>
  </image:image>
</url>

If you have videos:

Create separate video sitemap:

<url>
  <loc>https://yoursite.com/videos/tutorial</loc>
  <video:video>
    <video:thumbnail_loc>https://yoursite.com/thumb.jpg</video:thumbnail_loc>
    <video:title>How to Use Surmado Signal</video:title>
    <video:description>Learn AI visibility testing</video:description>
  </video:video>
</url>

Quick Wins

This week:

  1. Create sitemap (10 minutes using generator or plugin)
  2. Add to robots.txt (2 minutes)
  3. Submit to Google Search Console (5 minutes)

This month:

  1. Monitor Search Console → Sitemaps → Check “Discovered” count
  2. Fix any errors Google reports
  3. Update sitemap when you add new pages

Expected result:

  • Week 1: Google discovers sitemap
  • Week 2: Starts crawling pages
  • Week 3-4: New pages appear in search results

Related: Canonical URLs | Robots.txt Essentials

Help Us Improve This Article

Know a better way to explain this? Have a real-world example or tip to share?

Contribute and earn credits:

  • Submit: Get $25 credit (Signal, Scan, or Solutions)
  • If accepted: Get an additional $25 credit ($50 total)
  • Plus: Byline credit on this article
Contribute to This Article