If you manage a website and care about search visibility, an XML sitemap should be one of the first things you set up. It is the most direct way to tell search engines which pages exist on your site, when they were last updated, and how they relate to each other.
Yet many site owners either skip this step entirely or generate a sitemap once and never update it. This guide covers everything you need to know — from what sitemaps are to generating one and submitting it to Google.
What Is an XML Sitemap?
An XML sitemap is a structured file — typically named sitemap.xml — that lists the URLs on your website along with optional metadata about each page. Search engine crawlers like Googlebot read this file to discover and understand the structure of your site.
Here is what a basic sitemap looks like:
<?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-03-01</lastmod>
<changefreq>weekly</changefreq>
<priority>1.0</priority>
</url>
<url>
<loc>https://example.com/about</loc>
<lastmod>2026-02-15</lastmod>
<changefreq>monthly</changefreq>
<priority>0.8</priority>
</url>
</urlset>
Each <url> entry contains:
<loc>— The full URL of the page (required)<lastmod>— The date the page was last modified (recommended)<changefreq>— How often the page changes: daily, weekly, monthly (optional hint)<priority>— A value from 0.0 to 1.0 indicating relative importance within your site (optional)
Why XML Sitemaps Matter for SEO
1. Faster Discovery of New Pages
When you publish a new page or blog post, search engines may take days or weeks to find it through normal crawling. A sitemap provides a direct path for crawlers to discover new content immediately.
2. Better Crawl Efficiency
Large sites with thousands of pages can have crawl budget limitations — search engines allocate a finite number of pages they will crawl per visit. A sitemap helps them prioritize the pages that matter most.
3. Indexing Pages That Are Hard to Find
If some of your pages have few or no internal links pointing to them (orphan pages), crawlers may never find them. A sitemap ensures every important URL is on the radar.
4. Communicating Content Freshness
The <lastmod> tag tells search engines when content was updated. This can trigger re-crawling and re-indexing, which is valuable when you update existing content.
Which Websites Need a Sitemap?
Every website benefits from having a sitemap, but it is especially critical for:
- Large websites with hundreds or thousands of pages
- E-commerce sites with frequently changing product catalogs
- New websites that lack many external backlinks
- Sites with deep navigation where pages are many clicks from the homepage
- Media-rich sites with images, videos, or news content
Even a small blog with 20 pages benefits from a sitemap. The setup cost is minimal, and the upside is real.
How to Generate an XML Sitemap
Option 1: Use an Online Sitemap Generator
The fastest way to create a sitemap is with an online tool. The Sitemap Generator on ToolByte lets you enter your website URL, crawl the site, and generate a properly formatted XML sitemap in seconds.
The process is straightforward:
- Enter your website URL
- The tool crawls your site and discovers pages
- Review the discovered URLs
- Download the generated
sitemap.xmlfile
This approach works well for sites of any size and does not require installing anything.
Option 2: CMS Plugins
If you use a CMS:
- WordPress — Yoast SEO or Rank Math generate sitemaps automatically
- Shopify — Generates a sitemap at
/sitemap.xmlby default - Laravel — Packages like
spatie/laravel-sitemapcan generate sitemaps programmatically
Option 3: Manual Creation
For very small sites, you can write the XML by hand. This is not practical for anything beyond a dozen pages, but it gives you full control.
Sitemap Best Practices
Keep It Under 50,000 URLs
The sitemap protocol limits each file to 50,000 URLs and 50 MB uncompressed. For larger sites, use a sitemap index file that references multiple sitemap files:
<?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-03-01</lastmod>
</sitemap>
<sitemap>
<loc>https://example.com/sitemap-posts.xml</loc>
<lastmod>2026-03-01</lastmod>
</sitemap>
</sitemapindex>
Only Include Canonical URLs
Do not include URLs that redirect, return 404 errors, or are blocked by robots.txt. Every URL in your sitemap should return a 200 status code and be the canonical version of that page.
Update <lastmod> Accurately
Only change the <lastmod> date when the page content actually changes. Artificially updating dates does not trick search engines and can erode trust in your sitemap data.
Use HTTPS URLs
If your site uses HTTPS (and it should), ensure all sitemap URLs use the https:// scheme. Mixing HTTP and HTTPS causes confusion for crawlers.
Reference Your Sitemap in robots.txt
Add a reference to your sitemap at the end of your robots.txt file:
Sitemap: https://example.com/sitemap.xml
This helps crawlers from all search engines discover your sitemap automatically.
How to Submit Your Sitemap to Google
Step 1: Verify Your Site in Google Search Console
If you have not already, go to Google Search Console and verify ownership of your domain using one of the provided methods (DNS record, HTML file, meta tag, etc.).
Step 2: Navigate to Sitemaps
In the left sidebar, click Sitemaps under the Indexing section.
Step 3: Enter Your Sitemap URL
Type the URL of your sitemap (e.g., https://example.com/sitemap.xml) and click Submit.
Step 4: Monitor the Status
Google will show the submission status, number of discovered URLs, and any errors found. Check back after a few days to see how many URLs have been indexed.
Submitting to Bing
Bing Webmaster Tools has a similar sitemap submission feature. Log in, select your site, navigate to Sitemaps, and submit the URL. Bing also reads the Sitemap: directive in robots.txt.
Common Sitemap Mistakes
-
Including noindex pages — If a page has a
noindexmeta tag, do not include it in your sitemap. This sends conflicting signals. -
Stale sitemaps — A sitemap generated once and never updated becomes less useful over time. Regenerate it whenever you add or remove significant content.
-
Missing sitemap entirely — Some site owners assume search engines will find everything through links alone. This works for very small, well-linked sites but fails for anything larger.
-
Wrong URL format — Ensure URLs in the sitemap match exactly what you want indexed. Watch for trailing slashes, www vs. non-www, and HTTP vs. HTTPS inconsistencies.
Monitoring Sitemap Health
After submission, regularly check:
- Coverage report in Search Console — Shows indexed vs. excluded URLs
- Crawl stats — Indicates how actively Google is crawling your site
- Error reports — Highlights URLs that return errors
If you see a gap between submitted and indexed URLs, investigate why certain pages are being excluded.
Conclusion
An XML sitemap is a small file that carries significant weight in your SEO strategy. It ensures search engines can discover every important page on your site, understand when content changes, and prioritize crawling efficiently.
Generating one takes minutes. The Sitemap Generator on ToolByte handles the heavy lifting — crawling your site and producing a standards-compliant XML sitemap ready for submission. If you have not set one up yet, do it today. It is one of the simplest steps you can take to improve your search visibility.
For more developer and SEO tools, visit ToolByte — a free suite of practical utilities built by Duo Dev Technologies.