XML Sitemaps: What They Are, Why They Matter, and How to Create One
Technical SEO

XML Sitemaps: What They Are, Why They Matter, and How to Create One

S
SEO Journal Team
· · 8 min read

If your pages aren’t getting indexed, there’s a good chance Google simply hasn’t found them yet. XML sitemaps solve that problem. They’re one of the most straightforward technical SEO wins available — easy to create, easy to submit, and genuinely useful for getting your content into Google’s index faster.

This guide explains what XML sitemaps are, why they matter, and how to create and submit one correctly.

What Is an XML Sitemap?

An XML sitemap is a file that lists all the important URLs on your website. Think of it as a table of contents you hand directly to search engines. It tells Google (and Bing, and other crawlers) exactly which pages exist on your site and, optionally, when they were last updated.

Here’s what a simple XML sitemap entry looks like:

<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
  <url>
    <loc>https://yourdomain.com/blog/keyword-research-guide</loc>
    <lastmod>2025-03-15</lastmod>
    <changefreq>monthly</changefreq>
    <priority>0.8</priority>
  </url>
</urlset>

The <loc> tag is required. The others (<lastmod>, <changefreq>, <priority>) are optional but useful — Google has said it primarily cares about <lastmod> when it’s accurate.

XML Sitemap vs. HTML Sitemap

These are two different things:

  • XML sitemaps are machine-readable files designed for search engine crawlers. Users never see them directly.
  • HTML sitemaps are human-readable pages (like a site directory) that help visitors navigate your site.

For SEO purposes, XML sitemaps are what matter. HTML sitemaps can help with user experience but have minimal direct SEO value.

Why XML Sitemaps Matter for SEO

Faster Discovery and Indexing

Search engines discover new pages primarily through links — both internal links and external backlinks. But if you publish a new page and no other page links to it yet, it’s invisible to Googlebot. A sitemap bridges that gap by listing the URL directly, which means Google can discover and crawl it much faster.

Useful for Large or Complex Sites

For websites with hundreds or thousands of pages, JavaScript-heavy sites, or sites with pages that don’t have many internal links pointing to them, sitemaps are essential. They ensure Google doesn’t miss pages that would be difficult to find through crawling alone.

Signals Content Freshness

When you update a page and set an accurate <lastmod> date in your sitemap, it signals to Google that the page has fresh content worth recrawling. This won’t force Google to recrawl anything — it doesn’t work like a command — but it can influence crawl prioritization.

How to Create an XML Sitemap

Option 1: Use Yoast SEO (WordPress)

If you’re on WordPress, Yoast SEO generates and maintains your XML sitemap automatically. Once the plugin is active, your sitemap is available at yourdomain.com/sitemap.xml and updates dynamically whenever you publish or update content. You can configure which post types and taxonomies to include.

Rank Math is another popular WordPress plugin that handles sitemaps equally well.

Option 2: Use Screaming Frog

Screaming Frog is a desktop crawling tool that can generate an XML sitemap from a crawl of your site. This is particularly useful for non-WordPress sites.

Run a crawl, then go to Sitemaps > XML Sitemap to configure and export. The free version supports up to 500 URLs; the paid version handles unlimited pages.

Option 3: Create One Manually

For small sites (under 50 pages), you can write an XML sitemap by hand or use a free online generator like xml-sitemaps.com. Enter your domain, it crawls your site, and you download the resulting XML file.

The manual approach doesn’t scale well — you’ll need to update the file every time you publish new content. For anything beyond a small static site, use an automated tool.

Option 4: Use Your Static Site Generator

If you’re using a static site generator like Astro, Next.js, Gatsby, or Hugo, there are sitemap plugins for each that generate the file automatically at build time.

Submitting Your Sitemap to Google Search Console

Creating a sitemap is only half the job. You also need to tell Google where it is.

  1. Log into Google Search Console
  2. Select your property
  3. Navigate to Indexing > Sitemaps
  4. Enter your sitemap URL (usually /sitemap.xml) and click Submit

Google will fetch your sitemap and report how many URLs it found. Check back after a day or two to see if any errors were reported.

You should also add the sitemap URL to your robots.txt file so any crawler — not just Google — can find it automatically:

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

XML Sitemap Best Practices

Include only canonical, indexable URLs. Don’t include pages with noindex tags, redirect URLs, or pages blocked by robots.txt. Your sitemap should only list pages you actually want Google to index.

Keep sitemaps under 50,000 URLs and 50MB. For large sites, use a sitemap index file that links to multiple smaller sitemaps (one per content type, for example).

Use accurate <lastmod> dates. Only update the <lastmod> value when the page content has actually changed. Setting it to today’s date every day just to get recrawled will likely be ignored — and Google has said it downgrades sites that do this.

Create separate sitemaps for different content types. Many large sites use separate sitemaps for pages, posts, images, and videos. This makes it easier to diagnose indexation issues by content type.

Verify your sitemap returns no errors. After submitting, check Search Console regularly for sitemap errors, which can indicate pages with broken URLs or misconfigured markup.


A properly configured XML sitemap works alongside the rest of your technical SEO foundation. To see how sitemaps fit into the bigger picture, read through our technical SEO checklist. And if you’re still learning how search engines discover and process your pages in the first place, our guide on how search engines work is a great starting point.

Found this useful? Subscribe to the SEO Journal newsletter for weekly technical SEO guides, checklists, and practical tips.

#xml sitemap #sitemap #google search console #technical seo
Weekly SEO Newsletter

Get SEO Insights That
Actually Move the Needle

Join 12,000+ marketers and business owners who receive our weekly breakdown of SEO trends, strategies, and actionable tips — completely free.

No spam
Unsubscribe anytime
100% free

Related Articles