What is an XML sitemap?
XML sitemap is a machine-readable file that provides an overview of all pages on your website that Google should index. It is written in XML format and helps Googlebot crawl and index your website. An XML sitemap is not intended for human visitors - it is for search engines.
For B2B websites, a correctly implemented XML sitemap is an important function for fast indexing of new pages and complete coverage of all important pages.
XML Sitemap in B2B Context
B2B websites can quickly become complex: product pages, case studies, blog articles, resource pages. Without an XML sitemap, Google could miss important pages, especially if your internal linking structure is not perfect.
An XML sitemap accelerates indexing time for new content. When you publish a new blog article, it should be listed in your sitemap - Google will find and index it faster.
Structure of an XML Sitemap
An XML sitemap follows this schema:
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<url>
<loc>https://example.com/page1/</loc>
<lastmod>2024-03-01</lastmod>
<changefreq>weekly</changefreq>
<priority>0.8</priority>
</url>
<url>
<loc>https://example.com/page2/</loc>
<lastmod>2024-02-28</lastmod>
<changefreq>monthly</changefreq>
<priority>0.6</priority>
</url>
</urlset>
Explanation of fields:
- loc: The page URL (required)
- lastmod: Last modification date (optional)
- changefreq: How often the page changes (optional): always, hourly, daily, weekly, monthly, yearly, never
- priority: Relative priority (0.0 to 1.0, optional). Default is 0.5
XML Sitemap vs. HTML Sitemap
Do not confuse XML sitemap with HTML sitemap:
| Type | Format | Target Audience | Purpose |
|---|---|---|---|
| XML Sitemap | XML file | Search engines | Crawling and indexing |
| HTML Sitemap | HTML page | Human visitors | Navigation |
You can have both, but an XML sitemap is technically important. HTML sitemap is optional and helps mainly with page navigation.
Creating and Implementing XML Sitemap
Depending on the CMS, implementation differs:
- WordPress: Plugins like Yoast SEO generate automatically. Enable in plugin settings
- Static websites: Create manually in XML format and host at /sitemap.xml
- Programmed websites: Integrate into application code to generate dynamically
- E-commerce (Shopify, WooCommerce): Automatically generated, usually at /sitemap.xml
Regardless of how you create your sitemap: the URL must be /sitemap.xml - that is the standard that Google searches for automatically.
Submitting Sitemap to Google Search Console
After creating the XML sitemap, you must tell Google about it:
- Go to Google Search Console for your domain
- Navigate to Sitemaps (in the left menu)
- Enter "sitemap.xml" (or the full URL)
- Google will crawl and validate the sitemap
If errors are reported (invalid URLs, duplicates), fix them immediately.
Best practices for XML Sitemaps
- Only indexable pages: Only list pages you want Google to index (no noindex pages)
- Use canonical URLs: Each URL in the sitemap should be its canonical version
- Prefer HTTPS: Use HTTPS in sitemap URLs if HTTPS is available
- No parameters: Avoid tracking parameters or session IDs in sitemap URLs
- Lastmod accuracy: Keep lastmod data current, but only if actually changed
- Use priority sparingly: Priority is a hint, not a command. Google often ignores unrealistic priorities
- Respect limits: XML sitemaps can have max 50,000 URLs and 50 MB. For larger websites use multiple sitemaps
Multiple Sitemaps with Sitemap Index
For larger B2B websites with many pages, you can use multiple sitemaps with a sitemap index:
<?xml version="1.0" encoding="UTF-8"?>
<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<sitemap>
<loc>https://example.com/sitemap-blog.xml</loc>
</sitemap>
<sitemap>
<loc>https://example.com/sitemap-products.xml</loc>
</sitemap>
</sitemapindex>
This is particularly valuable if you have different content types (blog, products, case studies).
Sitemaps for Multilingual Websites
For B2B websites with multilingual versions, each language should have a separate sitemap. Additionally, you can use hreflang data in sitemaps:
<url>
<loc>https://example.de/page/</loc>
<xhtml:link rel="alternate" hreflang="en" href="https://example.com/page/"/>
<xhtml:link rel="alternate" hreflang="fr" href="https://example.fr/page/"/>
</url>
This shows Google which versions are equivalent.
Image and Video Sitemaps
If your website contains many images or videos, you can create specialized sitemaps:
- Image sitemap: For image SEO, helps Google find and index images
- Video sitemap: For video content, improves video search results
- News sitemap: If you have news or regularly updated content
These are specially formatted and can be used together with the main sitemap.
XML Sitemap Monitoring
Monitor your sitemap performance:
- Google Search Console: Shows how many URLs were crawled and indexed
- Error report: Shows invalid URLs or sitemap problems
- Indexation rate: If only 80% of your sitemap URLs are indexed, there could be a problem
- Crawl statistics: Shows how often Google visits your sitemap
Common Sitemap Errors
- 404 URLs in sitemap: Pages that don't exist but are listed
- Noindex pages listed: Pages with noindex should not be in sitemap
- Duplicate URLs: Same URL listed multiple times
- Incorrect character encoding: XML must be UTF-8
- Incomplete sitemap: Important pages missing
- Too frequent updates: Sitemap should only be updated when something actually changes
XML Sitemap and Robots.txt
You can also specify the sitemap location in robots.txt, although it is optional:
Sitemap: https://example.com/sitemap.xml
This is additional information to help Google find the sitemap.
Sitemap as Part of Technical SEO
An XML sitemap is a small but important part of technical SEO. A correctly implemented sitemap accelerates indexing, improves crawl efficiency, and ensures that Google finds all important pages.
For B2B websites that depend on organic lead generation, an optimized XML sitemap is a must-have, not a nice-to-have.