// blog/seo & marketing/
Back to Blog
SEO & Marketing · June 21, 2026 · 8 min read · Updated May 22, 2026

Sitemap XML Generator: Get Pages Indexed Faster

Sitemap XML Generator: Get Pages Indexed Faster

You build a website, publish 50 pages, and wait for Google to index them. A week later, only 12 show up in search results. Two weeks later, 23. A month later, 38. Some pages never get indexed at all.

This is a common frustration, and an XML sitemap is one of the most effective solutions. A sitemap is a file that lists every page on your site that you want search engines to find. It does not guarantee indexing (Google decides what to index based on quality), but it ensures search engines know about every page. Without a sitemap, search engines discover pages by following links, which means pages that are not well-linked internally might never be found.

The sitemap is not a ranking factor. Having one does not make your pages rank higher. But it makes your pages discoverable, which is the prerequisite for ranking at all. For new sites, sites with poor internal linking, or sites with thousands of pages, a sitemap is essential.

* * *

XML Sitemap Structure

An XML sitemap follows a specific format defined by the sitemap protocol (sitemaps.org).

`xml https://example.com/ 2026-06-21 weekly 1.0 https://example.com/about 2026-05-15 monthly 0.8 `

The elements:

(required): The full URL of the page. Must include the protocol (https://). URLs must be properly encoded. Spaces, special characters, and non-ASCII characters need URL encoding. The URL Encoder handles this conversion.

(optional but recommended): The date the page was last modified. Use ISO 8601 format (YYYY-MM-DD). Google has stated they use this signal, so keeping it accurate helps. Do not set all pages to today's date. That tells Google nothing useful.

(optional): How often the page changes. Values: always, hourly, daily, weekly, monthly, yearly, never. Google largely ignores this field, but it does not hurt to include it.

(optional): A value from 0.0 to 1.0 indicating the relative importance of pages on your site. This is relative to YOUR site, not the entire web. Google largely ignores this too, but setting your homepage to 1.0 and deep pages to 0.5-0.7 is reasonable.

Maximum sitemap size: 50,000 URLs or 50MB (uncompressed), whichever comes first. For larger sites, use a sitemap index file that references multiple sitemap files.

Search engine results page on a laptop screen
Search engine results page on a laptop screen
* * *

Sitemap Index Files for Large Sites

When your site has more than 50,000 pages, or when you want to organize URLs by type (blog posts, product pages, category pages), a sitemap index file references multiple individual sitemaps.

`xml https://example.com/sitemap-pages.xml 2026-06-21 https://example.com/sitemap-blog.xml 2026-06-20 https://example.com/sitemap-products.xml 2026-06-19 `

This organization has practical benefits:

  • You can update individual sitemaps without regenerating the entire set
  • Google Search Console shows indexing statistics per sitemap, making it easier to diagnose issues with specific content types
  • Automated build systems can generate sitemaps for different content types independently

For most sites under 10,000 pages, a single sitemap file is sufficient. The overhead of managing multiple sitemaps is not worth it unless you specifically need the per-type analytics from Google Search Console.

Some frameworks (Next.js, WordPress, Gatsby) generate sitemaps automatically as part of the build process. If your framework does this, review the generated sitemap to ensure it includes the pages you want indexed and excludes the ones you do not (admin pages, login pages, duplicate content).

Key takeaway

When your site has more than 50,000 pages, or when you want to organize URLs by type (blog posts, product pages, category pages), a sitemap index file references multiple individual sitemaps.

* * *

Common Sitemap Mistakes That Hurt Indexing

A poorly configured sitemap can be worse than no sitemap at all because it sends confusing signals to search engines.

Including non-canonical URLs. If you have https://example.com/page and https://www.example.com/page, include only the canonical version. Including both tells Google there is duplicate content, which is the opposite of helpful. Similarly, do not include URL variations with trailing slashes, query parameters, or uppercase letters if they serve the same content.

Including noindex pages. If a page has a tag, do not include it in the sitemap. Sending contradictory signals ("index this page" via sitemap, "do not index this page" via meta tag) confuses crawlers and wastes crawl budget.

Stale lastmod dates. Setting lastmod to the page creation date and never updating it makes the field useless. If you cannot maintain accurate dates, omit the field entirely rather than providing incorrect information.

Including soft 404s. Pages that return a 200 status code but show "page not found" content should not be in the sitemap. Google's crawler detects these and it reflects poorly on your site quality.

Not submitting the sitemap. Creating a sitemap and placing it at /sitemap.xml is only half the job. Submit it through Google Search Console and Bing Webmaster Tools so search engines know where to find it. Also reference it in your robots.txt file:

` Sitemap: https://example.com/sitemap.xml `

Broken URLs. Every URL in your sitemap should return a 200 status code. Run a crawl check on your sitemap URLs periodically. A sitemap full of 404s signals to Google that your site is poorly maintained.

* * *

Dynamic Sitemaps for Modern Web Frameworks

Static sitemap files work for small, infrequently changing sites. For dynamic sites where pages are added regularly, generating the sitemap programmatically ensures it stays up to date.

Next.js: Use the built-in sitemap.ts file in the app directory:

`typescript import { MetadataRoute } from 'next';

export default function sitemap(): MetadataRoute.Sitemap { const posts = getAllBlogPosts(); // your data source const blogUrls = posts.map(post => ({ url: https://example.com/blog/${post.slug}, lastModified: post.updatedAt, changeFrequency: 'weekly' as const, priority: 0.7, })); return [ { url: 'https://example.com', lastModified: new Date(), changeFrequency: 'daily', priority: 1.0, }, ...blogUrls, ]; } `

WordPress: Generates sitemaps automatically since version 5.5. Plugins like Yoast SEO or Rank Math provide more control over which post types, taxonomies, and pages are included.

Static site generators: Gatsby, Hugo, and Eleventy all have sitemap plugins that generate the file at build time.

For URL slugs that need to be SEO-friendly, the Slug Generator creates clean, lowercase, hyphenated slugs from any text. Properly formatted URLs look better in sitemaps and search results.

When debugging sitemap XML formatting issues, the Code Formatter can help you pretty-print the XML to identify structural problems like unclosed tags or incorrect nesting.

Website architecture diagram showing page hierarchy
Website architecture diagram showing page hierarchy
* * *

Submitting and Monitoring Your Sitemap

After generating your sitemap, submit it through these channels:

Google Search Console: Navigate to Sitemaps in the left menu, enter your sitemap URL, and click Submit. Google will show: - How many URLs were discovered - How many are indexed - Any errors encountered while processing the sitemap

Bing Webmaster Tools: Similar process. Submit the sitemap URL under the Sitemaps section.

robots.txt: Add a Sitemap directive. This is a universal method that works for all search engines: ` User-agent: * Allow: /

Sitemap: https://example.com/sitemap.xml `

Ping: You can notify search engines of sitemap updates via ping URLs: ` https://www.google.com/ping?sitemap=https://example.com/sitemap.xml `

Monitoring is where the real value of Search Console comes in. After submission, check:

  • Coverage report: Shows which URLs are indexed, which are excluded, and why. Common exclusion reasons include "Crawled, currently not indexed" (Google found it but chose not to index it) and "Discovered, currently not indexed" (Google knows about it but has not crawled it yet).
  • Errors: Invalid URLs, server errors, redirect chains. Fix these to improve crawl efficiency.
  • Index ratio: The percentage of submitted URLs that are actually indexed. A healthy site has an index ratio above 80% for quality content. Below 50% suggests quality or technical issues.

Check your sitemap status monthly. Changes in the index ratio or sudden increases in errors can indicate problems that need attention before they affect traffic.

* * *

FAQ

Do I need a sitemap if my site only has 20 pages?

A sitemap is not strictly necessary for very small sites with good internal linking. Google's crawler will likely find all 20 pages by following links. However, a sitemap still provides value because it tells Google which pages you consider important and when they were last updated. Given that generating one takes minimal effort, it is worth doing regardless of site size.

Will a sitemap fix my indexing problems?

A sitemap ensures Google knows about your pages, but it does not guarantee indexing. If pages are not being indexed despite being in the sitemap, the issue is likely content quality, duplicate content, or technical problems (slow loading, JavaScript rendering issues). Use Search Console's Coverage report to diagnose why specific URLs are not indexed.

Should I include images and videos in my sitemap?

Google supports image sitemaps and video sitemaps as extensions to the standard sitemap format. Including images helps Google discover images that might not be found through crawling alone (like images loaded via JavaScript). Video sitemaps help video content appear in Google Video search. For most sites, a standard URL sitemap is sufficient.

How often should I regenerate my sitemap?

For dynamic sites: regenerate on every deployment or content change. Most modern frameworks do this automatically. For static sites: regenerate whenever you add, remove, or significantly update pages. The key is that the sitemap accurately reflects the current state of your site. An outdated sitemap is worse than no sitemap.

Can I have multiple sitemaps for one domain?

Yes. Use a sitemap index file to reference multiple sitemaps. This is common for large sites that organize URLs by type (blog, products, categories) or by language/region. Each individual sitemap must still respect the 50,000 URL and 50MB limits.

Key takeaway

### Do I need a sitemap if my site only has 20 pages.