An XML sitemap is a file that lists all the important pages of your website, helping search engines like Google, Bing, and Yahoo discover and index your content. While search engines can find pages through links, a sitemap ensures that even deep or isolated pages get crawled. In this comprehensive guide, we'll cover everything you need to know about XML sitemaps, how to create them, and best practices for SEO.
Why Do You Need an XML Sitemap?
Sitemaps are especially important for:
- Large websites: Thousands of pages can be organized.
- New websites: Few external links, so sitemap helps discovery.
- Websites with rich media: Video, image, news sitemaps.
- Frequently updated content: Blogs, news sites.
How to Create an XML Sitemap
You have three main options:
- Manual creation: Write XML by hand (tedious).
- Online generators: Use tools like ours above – enter URLs, get XML.
- CMS plugins: WordPress plugins like Yoast SEO generate sitemaps automatically.
XML Sitemap Format
The standard XML sitemap protocol looks like this:
<?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-01-30</lastmod>
<changefreq>weekly</changefreq>
<priority>0.8</priority>
</url>
</urlset>
Each <url> element can contain:
<loc>(required): The full URL.<lastmod>(optional): Date of last modification (YYYY-MM-DD).<changefreq>(optional): How often content changes (always, hourly, daily, weekly, monthly, yearly, never).<priority>(optional): Relative importance from 0.0 to 1.0.
Best Practices for XML Sitemaps
- Include only canonical URLs (avoid duplicates).
- Keep sitemap size under 50MB or 50,000 URLs – if larger, split into multiple sitemaps and use a sitemap index file.
- Use absolute URLs (with https://).
- Update your sitemap whenever you add/remove important pages.
- Submit your sitemap to Google Search Console and Bing Webmaster Tools.
- Place the sitemap in your website's root directory (e.g.,
https://example.com/sitemap.xml).
Common Sitemap Mistakes to Avoid
- Including noindex pages.
- Using relative URLs.
- Not updating lastmod dates.
- Blocking sitemap in robots.txt.
- Submitting sitemap for non-existent pages (404).
Advanced: Image, Video, and News Sitemaps
For specialized content, you can extend the sitemap protocol:
- Image sitemap: Add
<image:image>tags to help Google Images index your pictures. - Video sitemap: Include video metadata like title, description, duration.
- News sitemap: For news articles, helps appear in Google News.
Example of an image sitemap entry:
<url>
<loc>https://example.com/page.html</loc>
<image:image>
<image:loc>https://example.com/image.jpg</image:loc>
<image:title>Sample Image</image:title>
</image:image>
</url>
How to Submit Your Sitemap to Google
- Sign in to Google Search Console.
- Add your property (website) and verify ownership.
- Go to "Sitemaps" in the left sidebar.
- Enter the URL of your sitemap (e.g.,
sitemap.xml) and click Submit. - Monitor for errors and coverage reports.
Ready to Create Your Sitemap?
Use our free XML Sitemap Generator above. Just paste your URLs, adjust settings, and get a ready-to-upload XML file. It's fast, secure, and completely free.
A well-structured sitemap is a small effort that yields big SEO rewards – better indexing, faster crawling, and improved visibility in search results.