StarDomain

XML Sitemap: What It Is and How to Create One

XML Sitemap: What It Is and How to Create One

An XML sitemap helps search engines discover and index your website pages efficiently.

What is a Sitemap?

A sitemap is an XML file that lists all important pages on your website. It acts as a roadmap for search engine crawlers like Google, Bing, and Yahoo.

Benefits

  • Faster indexing - Search engines find new pages quickly
  • Better crawling - Ensures all pages are discovered
  • Priority signals - Indicate which pages are most important
  • Update frequency - Tell crawlers how often content changes

Creating a Sitemap

WordPress (Easiest Method)

Using Yoast SEO:

  1. Install and activate Yoast SEO plugin
  2. Go to SEO → General → Features
  3. Enable "XML sitemaps"
  4. Your sitemap is at: yourdomain.com/sitemap_index.xml

Using Rank Math:

  1. Install Rank Math plugin
  2. Go to Rank Math → Sitemap Settings
  3. Enable sitemap module
  4. Access at: yourdomain.com/sitemap_index.xml

Manual Creation

Create a file named sitemap.xml in your root directory:

xml
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
  <url>
    <loc>https://yourdomain.com/</loc>
    <lastmod>2024-01-15</lastmod>
    <changefreq>daily</changefreq>
    <priority>1.0</priority>
  </url>
  <url>
    <loc>https://yourdomain.com/about</loc>
    <lastmod>2024-01-10</lastmod>
    <changefreq>monthly</changefreq>
    <priority>0.8</priority>
  </url>
</urlset>

Online Generators

For static sites, use free generators:

  • XML-Sitemaps.com
  • Screaming Frog (desktop tool)
  • Sitemap Generator by Small SEO Tools

Submitting to Search Engines

Google Search Console

  1. Go to search.google.com/search-console
  2. Add and verify your property
  3. Go to Sitemaps → Add a new sitemap
  4. Enter: sitemap.xml (or your sitemap URL)
  5. Click Submit

Bing Webmaster Tools

  1. Go to bing.com/webmasters
  2. Add your site
  3. Navigate to Sitemaps
  4. Submit your sitemap URL

robots.txt Reference

Add to your robots.txt file:

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

Sitemap Best Practices

  1. Keep it under 50MB - Split into multiple sitemaps if needed
  2. Maximum 50,000 URLs - Use sitemap index for larger sites
  3. Only include canonical URLs - No duplicates or redirects
  4. Update regularly - Reflect actual content changes
  5. Use HTTPS URLs - Match your site's protocol

Checking Sitemap Status

In Google Search Console

  • Go to Sitemaps
  • View submitted sitemaps
  • Check "Discovered URLs" vs "Indexed URLs"
  • Review any errors or warnings

Common Issues

  • 404 errors - Remove deleted pages from sitemap
  • Non-canonical URLs - Use canonical version only
  • Blocked by robots.txt - Ensure sitemap is accessible
  • Wrong format - Validate XML syntax

Sitemap Types

TypePurposeExample
StandardWeb pagessitemap.xml
ImageImages for Google Imagessitemap-images.xml
VideoVideo contentsitemap-videos.xml
NewsNews articlessitemap-news.xml

Monitoring & Maintenance

  • Check Search Console monthly
  • Update after major site changes
  • Remove outdated URLs
  • Monitor indexing coverage
  • Fix reported errors promptly