XML Sitemap Generator: How to Create and Submit Sitemaps

The definitive guide to XML sitemaps β€” from protocol basics to dynamic generation, validation, and submission to Google Search Console.

πŸ“… February 1, 2026 ⏱️ 13 min read ✍️ RiseTop Team

An XML sitemap is a roadmap of your website that helps search engines discover, crawl, and index your pages more efficiently. While search engines can find pages through links, a sitemap accelerates the process β€” especially for large sites, new websites, or pages that are isolated from the main navigation.

In this guide, we'll cover the sitemap protocol, different types of sitemaps, how to create and validate them, and how to submit them to Google for maximum crawl coverage.

What Is an XML Sitemap?

An XML sitemap is an XML file that lists the URLs on your website along with optional metadata about each URL, such as when it was last updated, how often it changes, and its priority relative to other pages on your site.

Think of it as a table of contents for search engines. Instead of relying solely on internal links to discover pages, Googlebot (and other crawlers) can read your sitemap and immediately know about every page you want indexed.

Do You Need a Sitemap?

Google recommends having a sitemap if your site meets any of these criteria:

πŸ’‘ Pro Tip: Even if your site is small, having a sitemap is still beneficial. It costs nothing, takes minutes to set up, and provides a clear signal to Google about your preferred URL structure.

XML Sitemap Protocol: Structure and Elements

The sitemap protocol is defined at sitemaps.org and uses XML namespace http://www.sitemaps.org/schemas/sitemap/0.9. Here's a standard sitemap structure:

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

Sitemap Elements Explained

ElementRequiredDescription
<urlset>βœ… YesRoot element that wraps all URLs
<url>βœ… YesParent element for each URL entry
<loc>βœ… YesFully qualified URL (including https://)
<lastmod>OptionalDate of last modification (W3C Datetime format)
<changefreq>OptionalHow often the page changes (Google largely ignores this)
<priority>OptionalPriority 0.0–1.0 relative to other pages on your site
⚠️ Important: Google has stated that <changefreq> and <priority> are largely ignored in modern crawling. Focus on providing accurate <lastmod> dates and a complete list of URLs.

Sitemap Size Limits and Rules

Types of Sitemaps

Standard XML Sitemap

Lists web pages. This is the most common type and what most websites need.

Sitemap Index File

When you have more than 50,000 URLs, you need multiple sitemaps. A sitemap index file references all individual sitemaps:

<?xml version="1.0" encoding="UTF-8"?> <sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"> <sitemap> <loc>https://example.com/sitemap-pages.xml</loc> <lastmod>2026-04-10</lastmod> </sitemap> <sitemap> <loc>https://example.com/sitemap-posts.xml</loc> <lastmod>2026-04-10</lastmod> </sitemap> <sitemap> <loc>https://example.com/sitemap-products.xml</loc> <lastmod>2026-04-09</lastmod> </sitemap> </sitemapindex>

Image Sitemap

Helps Google discover and index images on your pages:

<url> <loc>https://example.com/blog/my-article</loc> <image:image> <image:loc>https://example.com/images/hero.jpg</image:loc> <image:title>Article hero image</image:title> <image:caption>Description of the image</image:caption> </image:image> </url>

Video Sitemap

Provides metadata about videos embedded on your pages, including duration, thumbnail, and description. Essential for video SEO.

News Sitemap

For news publishers, a news sitemap helps Google discover and index articles quickly. URLs must be no more than two days old.

How to Create a Sitemap

Method 1: Use an Online Generator

The fastest way to create a sitemap is using our free XML Sitemap Generator. Simply enter your website URL, and the tool will crawl your site and generate a valid XML sitemap that you can download and upload to your server.

Method 2: CMS Plugins

Most CMS platforms have plugins that auto-generate and update sitemaps:

Method 3: Dynamic Sitemap Generation

For custom sites or large applications, generate sitemaps dynamically using server-side code. Here's a simple example in Python:

# Python dynamic sitemap generator import xml.etree.ElementTree as ET from datetime import datetime def generate_sitemap(urls): urlset = ET.Element('urlset') urlset.set('xmlns', 'http://www.sitemaps.org/schemas/sitemap/0.9') for url_data in urls: url = ET.SubElement(urlset, 'url') loc = ET.SubElement(url, 'loc') loc.text = url_data['url'] lastmod = ET.SubElement(url, 'lastmod') lastmod.text = url_data.get('lastmod', datetime.now().strftime('%Y-%m-%d')) priority = ET.SubElement(url, 'priority') priority.text = url_data.get('priority', '0.5') tree = ET.ElementTree(urlset) ET.indent(tree, space=' ') tree.write('sitemap.xml', xml_declaration=True, encoding='UTF-8') # Usage urls = [ {'url': 'https://example.com/', 'priority': '1.0'}, {'url': 'https://example.com/about', 'priority': '0.8'}, {'url': 'https://example.com/blog', 'priority': '0.9'}, ] generate_sitemap(urls)

For large sites, consider splitting dynamic sitemaps by content type and generating a sitemap index.

Submitting Your Sitemap to Google

Step 1: Upload the Sitemap

Place your sitemap.xml file in your website's root directory so it's accessible at https://yourdomain.com/sitemap.xml.

Step 2: Reference in Robots.txt

User-agent: * Disallow: Sitemap: https://yourdomain.com/sitemap.xml

Adding your sitemap URL to robots.txt helps crawlers discover it automatically.

Step 3: Submit to Google Search Console

  1. Open Google Search Console.
  2. Navigate to Sitemaps in the left sidebar.
  3. Enter your sitemap URL and click Submit.
  4. Wait for Google to process the sitemap (usually within minutes to hours).

Step 4: Submit to Bing

Bing uses the same sitemap format. Submit via Bing Webmaster Tools, or use the Bing URL Submission API for automated submission.

Sitemap Validation and Troubleshooting

Common Sitemap Issues

πŸ’‘ Best Practice: Ping Google when your sitemap updates by sending a GET request to https://www.google.com/ping?sitemap=https://yourdomain.com/sitemap.xml. This notifies Google immediately rather than waiting for the next crawl.

Sitemap Best Practices for 2026

  1. Keep sitemaps current β€” auto-update your sitemap when content is added, modified, or removed.
  2. Exclude non-indexable pages β€” don't include pages with noindex directives, redirected URLs, or error pages.
  3. Use absolute URLs β€” always include the full URL with protocol and domain.
  4. Split large sitemaps β€” use a sitemap index if you exceed 50,000 URLs or 50MB.
  5. Monitor in Search Console β€” regularly check the Sitemaps report for discovered vs. submitted URL counts and indexing issues.
  6. Compress large sitemaps β€” use gzip (.xml.gz) to reduce file size. Google accepts compressed sitemaps.
  7. Include hreflang for multilingual sites β€” add <xhtml:link> elements for alternate language versions.

Conclusion

An XML sitemap is one of the most straightforward yet powerful tools in your SEO arsenal. It gives search engines a clear, complete map of your website, ensuring that no important page goes undiscovered. Whether you're launching a new site or managing a sprawling e-commerce platform, a well-maintained sitemap is essential for maximum crawl coverage and indexing speed.

πŸ—ΊοΈ Generate Your XML Sitemap Now

Crawl your site and generate a valid XML sitemap in seconds. Auto-detect pages, images, and URLs with our free sitemap generator.

Try Sitemap Generator β†’