Sitemap XML Generator: Help Search Engines Index Your Site
An XML sitemap is a structured file that lists every page on your website you want search engines to find. Think of it as a roadmap for crawlers — instead of relying on bots to discover your pages by following links, you hand them a complete directory. For sites with hundreds of pages, deep link structures, or frequently updated content, a sitemap is essential for thorough indexing.
Why Your Site Needs a Sitemap
Search engine crawlers have a limited crawl budget for each website. They allocate a certain number of requests per visit, and pages buried deep in your navigation may never get crawled. A sitemap solves this by giving crawlers direct access to every URL, along with metadata about when each page was last updated and how important it is relative to the rest of your site.
Google, Bing, and other search engines all support the XML sitemap protocol and recommend submitting one. Sites without sitemaps often see slower indexing of new content and incomplete coverage of their pages in search results.
Sitemap XML Structure
A basic XML sitemap follows a strict format defined by the sitemaps.org protocol:
<?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-02-07</lastmod>
<changefreq>weekly</changefreq>
<priority>1.0</priority>
</url>
<url>
<loc>https://example.com/about</loc>
<lastmod>2026-01-15</lastmod>
<changefreq>monthly</changefreq>
<priority>0.8</priority>
</url>
</urlset>
Each <url> entry contains up to four elements that help search engines understand and prioritize your content.
Key Sitemap Elements
loc (Required)
The full URL of the page. Must be an absolute URL including the protocol:
<loc>https://example.com/blog/my-article</loc>
- Always use the canonical version of the URL (with or without
www, but be consistent) - Use
https://if your site supports it
lastmod (Recommended)
The date the page was last meaningfully modified. Use the W3C date format:
- Full date:
2026-02-07 - With time:
2026-02-07T14:30:00+00:00
Search engines use this to decide whether to re-crawl a page. Only update this value when the content actually changes — inflating dates does not help and can erode crawler trust.
changefreq (Optional)
A hint about how often the page content changes:
| Value | Meaning |
|---|---|
always | Changes on every access (live data) |
hourly | Updated every hour |
daily | Updated once a day |
weekly | Updated once a week |
monthly | Updated once a month |
yearly | Archived or rarely updated content |
never | Will not change (archived pages) |
Google has stated it largely ignores changefreq, but other search engines may still use it. Setting it accurately costs nothing and can help with comprehensive crawling.
priority (Optional)
A value from 0.0 to 1.0 indicating the relative importance of a page within your site:
- 1.0: Homepage, key landing pages
- 0.8: Major sections, category pages
- 0.6: Standard content pages
- 0.4: Less important pages, archive pages
- 0.2: Utility pages (privacy policy, terms)
Priority is relative to your own site only. Setting every page to 1.0 is the same as setting none at all — the value is meaningless without variation.
How to Use Our Sitemap Generator
- Add your page URLs — enter each URL you want included in the sitemap
- Set the last modified date — when each page was last updated
- Choose a change frequency — how often each page typically changes
- Assign priority values — rank page importance from 0.0 to 1.0
- Generate the XML — the tool produces valid, standards-compliant sitemap XML
- Download or copy — save as
sitemap.xmland upload to your site root
Where to Place Your Sitemap
The standard location is:
https://yourdomain.com/sitemap.xml
You should also reference your sitemap in two places:
- robots.txt — add
Sitemap: https://yourdomain.com/sitemap.xml - Google Search Console — submit the URL directly under the Sitemaps section
Sitemap Best Practices
- Keep it under 50,000 URLs per sitemap file. For larger sites, use a sitemap index file that references multiple individual sitemaps.
- File size limit is 50 MB uncompressed. Use gzip compression for large sitemaps.
- Only include indexable pages. Do not add URLs that return 404, 301 redirects, or have
noindextags. - Use canonical URLs consistently. If your canonical URL uses
https://www., every sitemap URL should match. - Update lastmod dates honestly. Search engines learn to trust sitemaps that report accurate modification dates and deprioritize ones that inflate them.
- Remove deleted pages promptly. Stale URLs in your sitemap waste your crawl budget.
Common Mistakes to Avoid
- Including non-canonical URLs. If
/pageand/page/both resolve, only include the canonical version. - Setting all priorities to 1.0. This provides no useful signal to crawlers. Use the full range to indicate real hierarchy.
- Forgetting to update the sitemap. A sitemap that never changes teaches crawlers to ignore it.
- Listing blocked URLs. Do not include pages blocked by robots.txt — this sends conflicting signals.
- Omitting the XML declaration. The file must start with
<?xml version="1.0" encoding="UTF-8"?>to be valid.
Frequently Asked Questions
Does having a sitemap guarantee my pages will be indexed? No. A sitemap is a request, not a guarantee. Search engines use it as a discovery tool but still decide independently whether to index each page based on content quality, crawl budget, and other factors.
How often should I update my sitemap? Update it whenever you add, remove, or significantly modify pages. For dynamic sites, consider automating sitemap generation as part of your build or deployment process.
Can I have multiple sitemaps? Yes. Use a sitemap index file that references individual sitemaps. This is the standard approach for large sites:
<?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>
</sitemap>
<sitemap>
<loc>https://example.com/sitemap-blog.xml</loc>
</sitemap>
</sitemapindex>
Do small websites need a sitemap? Even small sites benefit from a sitemap. It ensures crawlers find every page, especially new pages that may not yet have inbound links. For any site with more than a handful of pages, a sitemap is worth the minimal effort.
Try our free Sitemap XML Generator to create a valid XML sitemap and improve your search engine indexing.
Try Ghost Image Hub
The Chrome extension that makes managing your Ghost blog images a breeze.
Learn More