XML Sitemap Guide: How to Create and Submit Your Sitemap for SEO

2026-07-08 Technical SEO
XML Sitemap Guide: How to Create and Submit Your Sitemap for SEO

What Is an XML Sitemap?

An XML sitemap is a file that lists all the important pages on your website in a format search engines can read. It acts as a roadmap for Googlebot, helping crawlers discover and index your content efficiently. The sitemap is an XML file following the Sitemaps protocol, typically located at yourdomain.com/sitemap.xml.

According to Google, submitting a sitemap can help with crawl scheduling, especially for new or updated pages. While a sitemap does not guarantee crawling, it provides valuable metadata about your pages that helps Google prioritize what to crawl.

Why XML Sitemaps Matter for SEO

Google does not guarantee it will crawl every page on your site. Without a sitemap, crawlers rely on internal links to discover content. An XML sitemap explicitly tells Google which pages exist and which matter most.

Benefits of XML sitemaps:

  • Faster indexing of new pages (15-25% faster according to Search Engine Journal)
  • Better crawl budget allocation for large sites
  • Discovery of orphan pages not linked from other pages
  • Metadata about page updates and priorities

XML Sitemap Structure

An XML sitemap follows a specific structure with these key elements:

<urlset> Container element defining the sitemap protocol version.

<url> Each page gets its own URL entry.

<loc> The full URL. Use absolute URLs including protocol and domain.

<lastmod> Date last modified in ISO 8601 format (YYYY-MM-DD). Update only when content actually changes.

<changefreq> How often the page changes: always, hourly, daily, weekly, monthly, yearly, never.

<priority> Importance relative to other pages (0.0 to 1.0). Default is 0.5.

What to Include in Your Sitemap

Include: Homepage, category pages, product pages, blog posts, landing pages, about, contact, and other important static pages.

Exclude: Tag pages, author pages, thin content pages, duplicate pages, noindex pages, search result pages, internal admin pages.

Sitemap Best Practices

Keep Under 50,000 URLs

Google limit is 50,000 URLs or 50MB uncompressed. For larger sites, create multiple sitemaps and use a sitemap index file to organize them.

Use Absolute URLs

Always include protocol and domain. Use full URLs, not relative paths.

Update lastmod Dates

Only update lastmod when content actually changes. Fake lastmod dates reduce the sitemap's trustworthiness and can cause Google to ignore the metadata.

Include in robots.txt

Add Sitemap directive to your robots.txt file. This helps crawlers discover your sitemap automatically.

Submit to Google Search Console

Submit your sitemap URL in Google Search Console. This accelerates discovery and gives you crawl statistics.

Common Sitemap Mistakes

Mistake 1: Including Noindex Pages

Do not include pages with noindex tags. Google will see the conflicting signals and may ignore your sitemap.

Mistake 2: Never Updating

A static sitemap becomes stale quickly. Use a dynamic generator that updates automatically when you publish new content.

Mistake 3: Using Relative URLs

Always use absolute URLs. Relative URLs confuse crawlers and may cause indexing issues.

Mistake 4: Including Non-200 Status Pages

Only include pages that return 200 OK status. Do not include 301 redirects, 404 errors, or 500 server errors.

How to Generate an XML Sitemap

Our free Sitemap Generator creates XML sitemaps instantly. Paste your URLs or enter your domain, and the tool generates a complete sitemap with proper formatting, lastmod dates, and priority levels.

Submit Your Sitemap

After generating your sitemap:

Step 1: Upload to your website root directory (yourdomain.com/sitemap.xml)

Step 2: Add Sitemap directive to your robots.txt file

Step 3: Submit to Google Search Console under Sitemaps

Step 4: Submit to Bing Webmaster Tools under Sitemaps

Step 5: Monitor crawl statistics in both tools

Sources

JC
Written by
James Chen
Technical SEO Engineer
View all posts →

Try Our Free Tools

Put what you learned into practice with these free SEO tools: