SEO Guides

How to Create an XML Sitemap (Beginner’s Guide)

Learn how to create an XML sitemap, add it to your site and submit it to Google Search Console. A beginner-friendly guide with a free sitemap generator.

By ToolBubble Team5 min read
A website map diagram with connected pages leading to a search engine
In this article
  1. What is an XML sitemap?
  2. Why your site needs a sitemap
  3. How to create an XML sitemap step by step
  4. Which pages should you include?
  5. Do priority and change frequency matter?
  6. Sitemaps for large sites
  7. Common sitemap mistakes
  8. Image, video and news sitemaps
  9. How often should you update a sitemap?
  10. Sitemaps and site migrations
  11. How to check your sitemap is working
  12. Sitemap vs robots.txt: what’s the difference?
  13. Conclusion

Search engines find pages by following links. If some of your pages are new, deep in your site or poorly linked, they can be missed for weeks. A sitemap fixes that. In this guide you’ll learn how to create an XML sitemap, where to put it, and how to tell Google about it.

You don’t need to write any code. ToolBubble’s free sitemap generator does the hard part for you.

What is an XML sitemap?

An XML sitemap is a file that lists the pages on your website you want search engines to know about. It’s written in a simple, standard format that Google, Bing and other search engines understand.

A basic entry looks like this:

<url>
  <loc>https://example.com/blog/my-post</loc>
  <lastmod>2026-10-01</lastmod>
</url>

Each loc is a page address. The optional lastmod date tells search engines when the page last changed in a meaningful way. The full format is documented at sitemaps.org.

Why your site needs a sitemap

  • Faster discovery. New pages can be found without waiting for links to them.
  • Deep pages get crawled. Products or posts buried many clicks deep are listed directly.
  • Better insight. Google Search Console reports how many sitemap URLs are indexed and flags problems.
  • Change signals. Accurate lastmod dates help search engines prioritize updated content.

A sitemap doesn’t guarantee indexing or boost rankings by itself. It makes sure search engines know your pages exist.

How to create an XML sitemap step by step

  1. List your pages. Gather the URLs of every page you want indexed. Include your homepage, key category pages, products and articles.
  2. Remove what doesn’t belong. Leave out redirects, error pages, login pages, duplicates and anything set to noindex.
  3. Generate the file. Paste the list into ToolBubble’s Sitemap Generator. Optionally set the last modified date, change frequency and priority.
  4. Download sitemap.xml. The tool creates a standards-compliant file ready to upload.
  5. Upload it to your root folder. It should load at https://yourdomain.com/sitemap.xml.
  6. Reference it in robots.txt. Add the line Sitemap: https://yourdomain.com/sitemap.xml. The Robots.txt Generator can do this for you.
  7. Submit it to Google. In Google Search Console, open Sitemaps, paste the URL and click Submit.

That’s it. Google will fetch the sitemap and report on it within a few days.

Which pages should you include?

Quality matters more than quantity. A clean sitemap gives search engines a trustworthy list.

IncludeLeave out
Homepage and main sectionsPages that redirect elsewhere
Blog posts and articles404 and other error pages
Product and service pagesLogin, cart and account pages
Category pages with useful contentPages marked noindex
The canonical version of each pageDuplicate or parameter URLs

Before you publish the sitemap, run your URLs through the Broken Link Checker. Every URL should return a 200 OK status.

Do priority and change frequency matter?

Many generators offer priority and changefreq fields. Google has said it ignores both. Other search engines may glance at them, so they don’t hurt, but don’t spend time fine-tuning them.

The lastmod date is different. Google does use it when it’s consistently accurate. Only update it when the page content genuinely changes, not on every visit or build.

For the official advice, read Google’s sitemap overview in Search Central.

Sitemaps for large sites

One sitemap file can hold up to 50,000 URLs and 50 MB uncompressed. If your site is bigger, split it into several sitemaps and create a sitemap index that lists them.

Splitting by section, such as products, blog and categories, also makes Search Console reports easier to read. You’ll see at a glance which section has indexing problems.

Common sitemap mistakes

Listing redirected URLs. If a page redirects, list the final destination instead. Check chains with the Redirect Checker.

Mixing http and https. Use the exact canonical version of each URL, including https and www (or no www).

Blocking the sitemap in robots.txt. If robots.txt disallows the sitemap path, search engines can’t read it.

Forgetting to update it. A stale sitemap misses new pages. Many CMS platforms update theirs automatically. If yours doesn’t, regenerate it after publishing new content.

Image, video and news sitemaps

The standard sitemap lists pages. Search engines also support extensions for special content:

  • Image sitemaps list important images on each page. They help when images load through JavaScript and might otherwise be missed.
  • Video sitemaps describe videos with a title, description, thumbnail and duration. They help video content appear in video results.
  • News sitemaps list recent articles for publishers in Google News.

Most small and medium sites only need a standard page sitemap. Add extensions when images or videos are a core part of what you publish.

How often should you update a sitemap?

Update the sitemap whenever you add, remove or significantly change pages. For a blog that posts daily, that means daily. For a small business site, it might be a few times a year.

You don’t need to resubmit it in Search Console every time. Once Google knows the sitemap URL, it checks the file again on its own schedule. Resubmitting is useful after a big change, such as a site migration or a new section.

Sitemaps and site migrations

Moving to a new domain or URL structure is when sitemaps matter most. During a migration:

  1. Keep the old sitemap live for a while so search engines can find and follow the redirects.
  2. Publish a new sitemap with only the new URLs.
  3. Check that every old URL redirects with a single 301 to its new home.
  4. Watch the indexing report in Search Console for errors over the following weeks.

A clean sitemap during a move helps search engines transfer your rankings to the new URLs faster.

How to check your sitemap is working

Open the sitemap URL in your browser. You should see a list of your URLs, not an error page.

Then check the Sitemaps report in Google Search Console. It shows when Google last read the file, how many URLs it found, and any errors. If the status says “Couldn’t fetch,” check the URL and your robots.txt rules.

Sitemap vs robots.txt: what’s the difference?

These two files are often confused, but they do opposite jobs. A sitemap says “here are the pages I’d like you to find.” A robots.txt file says “here are the areas I’d rather you didn’t crawl.”

They work best together. Your robots.txt should allow crawling of every page in your sitemap, and it should include a line pointing to the sitemap. If a URL is listed in the sitemap but blocked in robots.txt, Search Console will flag the conflict.

Remember that robots.txt doesn’t remove pages from search results. To keep a page out of the index, use a noindex meta tag and leave the page crawlable so search engines can see that tag. The Meta Tag Generator can create the right robots tag for you.

One more tip: a sitemap is a suggestion, not a command. Search engines still decide what to crawl and index based on quality and usefulness. Strong internal links between your pages remain just as important as the sitemap itself.

Conclusion

Now you know how to create an XML sitemap: list your indexable pages, generate the file, upload it to your root folder, reference it in robots.txt and submit it to Google. It takes minutes, and it helps search engines find everything you publish.

Build yours now with ToolBubble’s free sitemap generator. No signup needed.

Frequently asked questions

Do I need an XML sitemap?

Small, well-linked sites can be found without one, but a sitemap helps search engines discover new and deep pages faster. It’s free and quick, so most sites should have one.

Where should I put my sitemap?

Place it in your site’s root folder, for example https://example.com/sitemap.xml. Then list it in robots.txt and submit it in Google Search Console.

How many URLs can one sitemap contain?

One sitemap file can hold up to 50,000 URLs and must be no larger than 50 MB uncompressed. Larger sites use a sitemap index file that points to several sitemaps.

Should every page be in my sitemap?

No. Include only canonical pages you want indexed. Leave out redirects, error pages, duplicate pages and pages marked noindex.

Does a sitemap improve rankings?

Not directly. A sitemap helps search engines find and crawl your pages. Rankings still depend on content quality, relevance and links.

  • #seo
  • #sitemap
  • #xml sitemap
  • #google search console
  • #technical seo

Written by

ToolBubble Team

The team behind ToolBubble, a free collection of browser-based tools for files, media and everyday work.

We read every message

Can’t find the tool you need?

Tell us what you’re trying to do. Many ToolBubble tools started as a request from someone like you.