If Google can’t find your pages, they won’t rank. It’s that simple.

An XML sitemap acts as a roadmap for search engines, telling them exactly where all your important pages are located. Without one, you’re essentially hoping Google stumbles across your content by accident.

The good news? Creating an XML sitemap is far easier than most people think. Whether you’re running WordPress, using a CMS, or building a site from scratch, this xml sitemap tutorial will show you exactly how to get it done in minutes.

Quick answer.

  • An XML sitemap is a file that lists all the important URLs on your website for search engines
  • Most CMS platforms like WordPress generate sitemaps automatically through plugins
  • You can create one manually, use online generators, or rely on SEO tools like Screaming Frog
  • Submit your sitemap through Google Search Console for faster indexing
  • Keep your sitemap under 50,000 URLs and 50MB (uncompressed)

What is an XML sitemap and why does it matter?

An XML sitemap is a specially formatted file that provides search engines with a comprehensive list of URLs you want indexed. Think of it as handing Google a directory of your entire site rather than making their crawlers hunt through your navigation.

According to Google’s official documentation, sitemaps help search engines “efficiently crawl a website in its entirety, regardless of the visible navigation for visitors.” This becomes particularly important for larger sites with hundreds or thousands of pages.

The XML sitemap structure and format follows a standardised protocol that all major search engines understand. Each URL entry can include additional metadata like when the page was last modified, helping search engines prioritise which content to crawl first.

Do you actually need an XML sitemap?

Not every website requires a sitemap, but most benefit from having one. Google recommends sitemaps especially in these situations:

Your site is large with 500 or more pages. Your pages aren’t well linked through internal navigation. Your site is new with few external backlinks. You have rich media content like videos or images. Your site uses JavaScript rendering.

Even for smaller sites, having a sitemap provides an extra layer of assurance that search engines can access all your content. It’s a small effort that removes unnecessary barriers to indexation.

How to create an XML sitemap using WordPress.

WordPress makes sitemap creation almost effortless. If you’re running version 5.5 or later, WordPress automatically generates a basic sitemap at yoursite.com/wp-sitemap.xml.

However, most SEO professionals prefer using dedicated plugins for greater control. Yoast SEO and Rank Math both generate comprehensive sitemaps automatically once installed. Simply navigate to the plugin settings, ensure sitemaps are enabled, and your sitemap is ready.

For Yoast users: Go to Yoast SEO, then General, then Features, and ensure XML sitemaps is toggled on. Click the question mark icon to view your sitemap URL.

The plugin approach offers advantages like automatically excluding noindex pages, splitting large sitemaps into manageable chunks, and updating whenever you publish new content.

How to create an XML sitemap manually.

If you prefer complete control or your site doesn’t use a CMS, manual creation is straightforward. You’ll need a text editor and an understanding of the basic XML structure.

Every XML sitemap starts with a declaration and urlset element. Here’s the basic template:

<?xml version=1.0 encoding=UTF-8?>

<urlset xmlns=http://www.sitemaps.org/schemas/sitemap/0.9>

  <url>

    <loc>https://www.yoursite.com/page-one/</loc>

    <lastmod>2025-01-15</lastmod>

  </url>

  <url>

    <loc>https://www.yoursite.com/page-two/</loc>

    <lastmod>2025-01-10</lastmod>

  </url>

</urlset>

The essential elements are the loc tag containing your full URL and optionally the lastmod tag showing when the page was last significantly updated. Google has confirmed they ignore the priority and changefreq tags, so don’t waste time on those.

Save your file as sitemap.xml and upload it to your root directory. You can verify it works by visiting yoursite.com/sitemap.xml in your browser.

How to create an XML sitemap using online generators.

For sites without CMS support, online generators offer a quick solution. Tools like XML-Sitemaps.com allow you to enter your website URL and automatically crawl your site to generate a sitemap file.

The process typically works like this: enter your homepage URL, let the tool crawl your pages, download the generated XML file, and upload it to your server. Most free tools limit you to 500 pages, which covers many small to medium websites.

Keep in mind that generated sitemaps are static snapshots. You’ll need to regenerate and re-upload whenever you add significant new content, making this approach less ideal for frequently updated sites.

How to create an XML sitemap using Screaming Frog.

SEO professionals often prefer Screaming Frog for sitemap generation because it offers granular control over what’s included. The free version handles sites up to 500 URLs.

Open Screaming Frog, enter your website URL, and start the crawl. Once complete, navigate to Sitemaps in the top menu and select XML Sitemap. The tool presents configuration options for including images, last modified dates, and filtering specific pages.

This method works well for technical SEO audit tool purposes too, since you can identify issues during the same crawl. You’ll spot broken links, redirect chains, and missing meta data while building your sitemap.

What to include in your XML sitemap.

Not every page belongs in your sitemap. Include pages you actually want appearing in search results: your homepage, main category pages, product pages, blog posts, and important informational content.

Exclude pages that serve no purpose in search results: thank you pages, login pages, staging URLs, paginated archives, and anything marked noindex. Including these clutters your sitemap and wastes crawl budget.

Google’s Gary Illyes has emphasised that sitemaps should contain only “canonical URLs that you want to show up in search results.” This aligns with maintaining clean URL structure for better SEO across your entire site.

If you’re experiencing common Google indexing issues, auditing your sitemap for incorrect inclusions is often a productive first step. Ensure every URL returns a 200 status code and points to the version you want indexed.

How to submit your XML sitemap to Google.

Creating the sitemap is only half the battle. You need to tell Google where to find it.

The recommended method is through Google Search Console. Navigate to your property, select Sitemaps from the left menu, enter your sitemap URL, and click Submit. Search Console will show the submission status and report any errors detected.

Alternatively, add a reference in your robots.txt file:

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

This method works well for multiple sitemaps or when you want search engines to find your sitemap without manual submission. Google will discover it during their next robots.txt check.

XML sitemap best practices to follow.

Several technical considerations ensure your sitemap functions correctly. Keep individual sitemaps under 50,000 URLs and 50MB uncompressed. For larger sites, use a sitemap index file that references multiple smaller sitemaps.

Use absolute URLs with the full protocol and domain. Relative URLs like /page-name/ won’t work. Ensure consistent URL formatting matching your canonical preferences, whether that’s www or non-www, http or https.

The lastmod date matters more than people realise. Google’s documentation confirms they use this value “if it’s consistently and verifiably accurate.” Update it only when making significant content changes, not for minor edits like fixing typos.

For comprehensive guidance on these technical elements, the complete technical SEO guide covers sitemap requirements alongside other essential ranking factors.

Common XML sitemap mistakes to avoid.

Many site owners unknowingly sabotage their sitemaps through avoidable errors. Including URLs that redirect, return 404 errors, or are blocked by robots.txt creates confusion for search engines and wastes processing time.

Another frequent mistake is mismatching sitemap URLs with canonical tags. If your sitemap lists https://www.site.com/page but your canonical points to https://site.com/page, you’re sending conflicting signals.

Neglecting to update your sitemap ranks among the most common issues. If you’ve added hundreds of pages since your last update, search engines might miss them entirely. Automated solutions through your CMS solve this problem completely.

When dealing with website not indexed solutions, examining sitemap accuracy often reveals the root cause. Pages missing from sitemaps or incorrectly formatted entries frequently explain indexation failures.

Sitemap index files for large websites.

Sites exceeding 50,000 URLs need a sitemap index file. This master file references multiple individual sitemaps, keeping everything organised while staying within limits.

The structure looks like this:

<?xml version=1.0 encoding=UTF-8?>

<sitemapindex xmlns=http://www.sitemaps.org/schemas/sitemap/0.9>

  <sitemap>

    <loc>https://www.yoursite.com/sitemap-posts.xml</loc>

  </sitemap>

  <sitemap>

    <loc>https://www.yoursite.com/sitemap-products.xml</loc>

  </sitemap>

</sitemapindex>

Segmenting sitemaps by content type, whether posts, products, or categories, makes monitoring easier in Search Console. You can track indexation rates for each section independently.

Understanding technical SEO ranking factors helps contextualise why proper sitemap architecture matters for larger sites competing in competitive markets.

Different types of XML sitemaps.

Standard XML sitemaps cover regular web pages, but Google supports several specialised formats. Image sitemaps help surface visual content in Google Images. Video sitemaps provide metadata about your video content. News sitemaps accelerate indexing for time-sensitive journalism.

You can combine these extensions within a single sitemap file. For example, adding image location data to existing URL entries helps Google understand which images belong to each page.

Most SEO plugins handle these variations automatically. Yoast generates separate image sitemaps, while video sitemap plugins handle rich media. Unless you have specific requirements, the standard format covers most websites adequately.

How to check if your sitemap is working.

After submission, verification ensures everything functions correctly. In Google Search Console, the Sitemaps report shows whether Google successfully read your file and how many URLs were discovered versus indexed.

A healthy sitemap shows status “Success” with discovered URLs matching your expectations. Significant gaps between discovered and indexed URLs indicate potential quality issues with those pages rather than sitemap problems.

You can also test your sitemap directly by visiting the URL in your browser. Valid XML displays cleanly with proper formatting. Errors produce browser warnings or garbled text indicating syntax problems.

For deeper analysis, our technical SEO audit tool can identify sitemap issues alongside other technical factors affecting your site’s search performance.

How sitemaps fit into your broader SEO strategy.

Sitemaps represent one component of technical SEO, the foundation that ensures search engines can access and understand your content. They work alongside proper URL structure for better SEO, internal linking, and crawl management.

Having a perfect sitemap won’t compensate for thin content or poor user experience. However, neglecting sitemaps can prevent excellent content from ever reaching search results.

For businesses serious about organic growth, combining solid technical foundations with quality content creates sustainable results. A well-maintained sitemap ensures no page gets overlooked during indexation.

If you’re looking to implement these SEO strategies but don’t have the time or team bandwidth, our SEO services can help you execute them effectively while you focus on running your business. As a melbourne based seo company, we’ve helped hundreds of Australian businesses improve their technical SEO foundations.

Maintaining your sitemap over time.

Sitemaps require ongoing attention, not set-and-forget implementation. Remove URLs when you delete pages or consolidate content. Add new pages as you publish them. Update lastmod dates when making meaningful changes.

Automated solutions handle most maintenance automatically. CMS plugins regenerate sitemaps with each publish action. Dynamic sitemaps pull directly from your database, always reflecting current content.

Manual sitemaps need scheduled reviews. Monthly checks for smaller sites and weekly reviews for larger operations prevent drift between your actual content and what your sitemap reports.

The investment in SEO-friendly website development from the start reduces ongoing maintenance burden. Sites built with proper architecture require less manual sitemap management.

 

<div class=”faqWrapper”><section class=”section-paragraph section-faqs” style=”max-width: 800px; padding: 0; margin: 0;”><h2 style=”margin-bottom: 15px;”><b>XML Sitemap </b><b>FAQs.</b></h2><div class=”card” style=”width: 100%; background: transparent; border: none; box-shadow: none; padding: 0; margin: 0;”><div class=”card-header collapsed” style=”background: transparent; padding: 5px 0; border: none; cursor: pointer;” data-toggle=”collapse” data-target=”#faq1″><h3 class=”h3-accordion-title-fpau” style=”padding-left: 25px; margin: 0; font-size: 1.1rem;”>What is the easiest way to create an XML sitemap?</h3></div><div id=”faq1″ class=”collapse”><div class=”card-body” style=”padding: 5px 0 15px 25px; color: #555;”>The easiest method is using a WordPress plugin like Yoast SEO or Rank Math. Once installed, these plugins automatically generate and maintain your sitemap without any manual work required.</div></div></div><div class=”card” style=”width: 100%; background: transparent; border: none; box-shadow: none; padding: 0; margin: 0;”><div class=”card-header collapsed” style=”background: transparent; padding: 5px 0; border: none; cursor: pointer;” data-toggle=”collapse” data-target=”#faq2″><h3 class=”h3-accordion-title-fpau” style=”padding-left: 25px; margin: 0; font-size: 1.1rem;”>How do I submit my XML sitemap to Google?</h3></div><div id=”faq2″ class=”collapse”><div class=”card-body” style=”padding: 5px 0 15px 25px; color: #555;”>Log into Google Search Console, select your property, click Sitemaps in the left menu, enter your sitemap URL, and click Submit. You can also add a sitemap reference to your robots.txt file.</div></div></div><div class=”card” style=”width: 100%; background: transparent; border: none; box-shadow: none; padding: 0; margin: 0;”><div class=”card-header collapsed” style=”background: transparent; padding: 5px 0; border: none; cursor: pointer;” data-toggle=”collapse” data-target=”#faq3″><h3 class=”h3-accordion-title-fpau” style=”padding-left: 25px; margin: 0; font-size: 1.1rem;”>What is the maximum size for an XML sitemap?</h3></div><div id=”faq3″ class=”collapse”><div class=”card-body” style=”padding: 5px 0 15px 25px; color: #555;”>A single XML sitemap can contain a maximum of 50,000 URLs and must be no larger than 50MB uncompressed. For larger sites, use a sitemap index file that references multiple smaller sitemaps.</div></div></div><div class=”card” style=”width: 100%; background: transparent; border: none; box-shadow: none; padding: 0; margin: 0;”><div class=”card-header collapsed” style=”background: transparent; padding: 5px 0; border: none; cursor: pointer;” data-toggle=”collapse” data-target=”#faq4″><h3 class=”h3-accordion-title-fpau” style=”padding-left: 25px; margin: 0; font-size: 1.1rem;”>Should I include every page in my XML sitemap?</h3></div><div id=”faq4″ class=”collapse”><div class=”card-body” style=”padding: 5px 0 15px 25px; color: #555;”>No. Only include pages you want appearing in search results. Exclude thank you pages, login pages, staging URLs, paginated archives, and any pages marked with noindex.</div></div></div><div class=”card” style=”width: 100%; background: transparent; border: none; box-shadow: none; padding: 0; margin: 0;”><div class=”card-header collapsed” style=”background: transparent; padding: 5px 0; border: none; cursor: pointer;” data-toggle=”collapse” data-target=”#faq5″><h3 class=”h3-accordion-title-fpau” style=”padding-left: 25px; margin: 0; font-size: 1.1rem;”>How often should I update my XML sitemap?</h3></div><div id=”faq5″ class=”collapse”><div class=”card-body” style=”padding: 5px 0 15px 25px; color: #555;”>If using a CMS plugin, your sitemap updates automatically when you publish content. For manual sitemaps, update whenever you add or remove pages, or make significant content changes to existing pages.</div></div></div><div class=”card” style=”width: 100%; background: transparent; border: none; box-shadow: none; padding: 0; margin: 0;”><div class=”card-header collapsed” style=”background: transparent; padding: 5px 0; border: none; cursor: pointer;” data-toggle=”collapse” data-target=”#faq6″><h3 class=”h3-accordion-title-fpau” style=”padding-left: 25px; margin: 0; font-size: 1.1rem;”>Does Google use the priority and changefreq tags?</h3></div><div id=”faq6″ class=”collapse”><div class=”card-body” style=”padding: 5px 0 15px 25px; color: #555;”>No. Google’s official documentation confirms they ignore both priority and changefreq values. However, Google does use the lastmod tag if it accurately reflects when content was last significantly updated.</div></div></div></section></div><script type=”application/ld+json”>{“@context”:”https://schema.org”,”@type”:”FAQPage”,”mainEntity”:[{“@type”:”Question”,”name”:”What is the easiest way to create an XML sitemap?”,”acceptedAnswer”:{“@type”:”Answer”,”text”:”The easiest method is using a WordPress plugin like Yoast SEO or Rank Math. Once installed, these plugins automatically generate and maintain your sitemap without any manual work required.”}},{“@type”:”Question”,”name”:”How do I submit my XML sitemap to Google?”,”acceptedAnswer”:{“@type”:”Answer”,”text”:”Log into Google Search Console, select your property, click Sitemaps in the left menu, enter your sitemap URL, and click Submit. You can also add a sitemap reference to your robots.txt file.”}},{“@type”:”Question”,”name”:”What is the maximum size for an XML sitemap?”,”acceptedAnswer”:{“@type”:”Answer”,”text”:”A single XML sitemap can contain a maximum of 50,000 URLs and must be no larger than 50MB uncompressed. For larger sites, use a sitemap index file that references multiple smaller sitemaps.”}},{“@type”:”Question”,”name”:”Should I include every page in my XML sitemap?”,”acceptedAnswer”:{“@type”:”Answer”,”text”:”No. Only include pages you want appearing in search results. Exclude thank you pages, login pages, staging URLs, paginated archives, and any pages marked with noindex.”}},{“@type”:”Question”,”name”:”How often should I update my XML sitemap?”,”acceptedAnswer”:{“@type”:”Answer”,”text”:”If using a CMS plugin, your sitemap updates automatically when you publish content. For manual sitemaps, update whenever you add or remove pages, or make significant content changes to existing pages.”}},{“@type”:”Question”,”name”:”Does Google use the priority and changefreq tags?”,”acceptedAnswer”:{“@type”:”Answer”,”text”:”No. Google’s official documentation confirms they ignore both priority and changefreq values. However, Google does use the lastmod tag if it accurately reflects when content was last significantly updated.”}}]}</script>