Skip to content
ScriptGarden

SEO basics

XML Sitemaps Explained: What They Are and How to Create One

By ScriptGarden · 5 min read · Updated

The short answer

An XML sitemap is a file listing the pages you want search engines to find. Create it, upload it to your site, add it to your robots.txt and submit it in Google Search Console. A single sitemap can hold up to 50,000 addresses.

What is an XML sitemap?

A sitemap is a list of your pages in a format search engines can read. It tells them which pages exist and, optionally, when they last changed. It helps crawlers discover pages faster, especially on new sites or for pages with few links pointing at them.

Do you need one?

A small site with good internal links may be crawled well without one, but a sitemap does no harm and helps most sites. It matters more for large sites, new sites and sites with pages that are hard to reach by links.

What to include

  • Only pages you want in search results.
  • The canonical address of each page.
  • Pages that return a normal 200 response, not redirects or errors.
  • Leave out pages marked noindex or blocked in robots.txt.

What about priority and change frequency?

Google has said it ignores the priority and change-frequency fields, so you can leave them out. Add a last-modified date only if it is accurate for each page.

How to create and submit one

  1. Make the file with the XML Sitemap Generator: let it find your pages or paste a list.
  2. Upload sitemap.xml to the top folder of your site.
  3. Add a Sitemap line to your robots.txt, using the Robots.txt Generator if you do not have one yet.
  4. Submit the address in Google Search Console and Bing Webmaster Tools.

Try the free tools

Frequently asked questions

Does a sitemap guarantee indexing?

No. It tells search engines the pages exist. Whether they are indexed depends on their quality and uniqueness.

Where should the sitemap live?

In the top folder, at your-domain.com/sitemap.xml, though other locations work if you submit the address.

How often should I update it?

Whenever you add, remove or move pages. Many website platforms and plugins update it for you automatically.

Sources and further reading