What is a sitemap and how to create one: a complete guide

What a sitemap is, when you really need one, and how to create it and submit it to Google Search Console.

AccessBy Javier Castillo8 min readReviewed on

Your site may have been online for years and have good content, and you still wonder whether you really need a sitemap, or you have one and have not looked at it since you installed it. The short answer is that it depends on the size and architecture of your site: a sitemap is not a box every website has to tick, although in many cases it does make the difference between Google finding your pages quickly or late.

In this guide you will see what a sitemap actually is, when it adds real value and when it is not critical, how to create one depending on the kind of site you have, and how to submit it and check that it works in Google Search Console.

What is a sitemap

A sitemap is a file that lists the URLs on your site that you want crawlers to know about and, where relevant, when each one was last updated. It is not persuasive copy or a page a user sees while browsing: it is a file made for machines, usually in XML format, that helps search engines discover content and prioritise what to crawl again.

It is important not to confuse it with another thing that sometimes goes by the same name: the site map made for people.

XML sitemap vs HTML sitemap

The sitemap.xml is the technical file aimed at crawlers such as Googlebot: a list of URLs in a structured format that a search engine can read automatically. The HTML site map, by contrast, is an ordinary page, visible to any user, with links organised by section to help people navigate the site.

Both can live in the same project, but they do different jobs: one talks to crawlers, the other to people.

how to create a sitemap

What it is for and when you really need one

A sitemap makes crawling and indexing easier, but it does not guarantee indexing or improve rankings directly: it is a starting point for Google to find your URLs, not a signal of quality or relevance. That said, there are scenarios where it clearly pays off:

  • Large sites, with thousands of pages, where natural crawling through links can take a long time to reach all the content.
  • Sites that publish new content frequently, such as news outlets or active blogs, where you want Google to spot what is new quickly.
  • Pages with weak internal linking, or practically orphaned, with few internal links pointing to them.
  • Deep architectures, where a page sits many clicks away from the homepage.

At the other end, a small site with solid internal linking (few pages, all well connected to each other) can work perfectly well without a sitemap: Google already crawls them by following the links. Having one does no harm, but it is not essential in that case.

Anatomy of a sitemap.xml

The sitemap protocol defines a simple structure, with required tags and optional ones. The required ones are <urlset> (the root element), <url> (each entry) and <loc> (the URL itself). The <lastmod> tag is optional but recommended when its value is reliable and reflects real content changes: Google can use it to decide whether a URL is worth crawling again. The <priority> and <changefreq> tags, on the other hand, are part of the protocol but Google ignores them when crawling.

Each sitemap file has a limit of 50,000 URLs and 50 MB uncompressed. If your site goes beyond that, you use a sitemap index that groups several files together.

Examples of sitemap.xml

The basic example works for most sites, but it is not always the only case: a large site needs to split its sitemap across several files, and an online shop or a media outlet with a lot of visual content may need to declare images or videos explicitly. These are the most common formats.

Basic sitemap.xml example

The minimum structure, with the required tags plus lastmod as a recommended extra:

<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
  <url>
    <loc>https://www.yourdomain.com/</loc>
    <lastmod>2026-07-15</lastmod>
  </url>
  <url>
    <loc>https://www.yourdomain.com/blog/example-article</loc>
    <lastmod>2026-08-01</lastmod>
  </url>
</urlset>

Sitemap index example (several files)

When a site goes past the limit of 50,000 URLs or 50 MB per file, you split the content across several sitemaps and declare an index that groups them all:

<?xml version="1.0" encoding="UTF-8"?>
<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
  <sitemap>
    <loc>https://www.yourdomain.com/sitemap-products.xml</loc>
    <lastmod>2026-08-10</lastmod>
  </sitemap>
  <sitemap>
    <loc>https://www.yourdomain.com/sitemap-blog.xml</loc>
    <lastmod>2026-08-15</lastmod>
  </sitemap>
</sitemapindex>

This index file is the one you submit to Search Console; each individual sitemap it contains follows the same rules as any normal sitemap.

Image sitemap example

Useful when you have images Google might not discover any other way, for example if they load via JavaScript. It is added as an extension on top of the normal sitemap:

<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"
    xmlns:image="http://www.google.com/schemas/sitemap-image/1.1">
  <url>
    <loc>https://www.yourdomain.com/product/example</loc>
    <image:image>
      <image:loc>https://www.yourdomain.com/images/product-1.jpg</image:loc>
    </image:image>
    <image:image>
      <image:loc>https://www.yourdomain.com/images/product-2.jpg</image:loc>
    </image:image>
  </url>
</urlset>

Google simplified this extension in 2022 and no longer takes into account tags such as caption, title or license; the tag that is still valid and useful is image:loc, the direct URL of the image.

Video sitemap example

For pages with video content, with the tags Google still recommends (title, description, thumbnail and the location of the file itself or of the player):

<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"
    xmlns:video="http://www.google.com/schemas/sitemap-video/1.1">
  <url>
    <loc>https://www.yourdomain.com/blog/video-tutorial</loc>
    <video:video>
      <video:thumbnail_loc>https://www.yourdomain.com/thumbnails/tutorial.jpg</video:thumbnail_loc>
      <video:title>Step-by-step tutorial</video:title>
      <video:description>A short explanation of what the video is about.</video:description>
      <video:content_loc>https://www.yourdomain.com/videos/tutorial.mp4</video:content_loc>
    </video:video>
  </url>
</urlset>

How to create a sitemap

The method depends on the platform your site is built on.

WordPress and other CMSs

If you use WordPress, you most likely already have a sitemap generated automatically by an SEO plugin such as Yoast SEO or Rank Math, without having had to configure anything.

These plugins update the sitemap every time you publish or change content, usually available at a URL such as /sitemap_index.xml. Other CMSs with a plugin ecosystem (Shopify, Wix, Squarespace) usually generate it natively.

Large sites or sites without a standard CMS

For bespoke projects, applications or sites with thousands of dynamically generated URLs (online shops, classified ad portals), the usual approach is to generate the sitemap programmatically: a script that queries the database and produces the XML periodically, or a dedicated generator that crawls the site and exports the file.

Creating one by hand

Writing the XML by hand is only viable for very small sites, with a handful of pages that barely change. Even then it has one clear drawback: it does not update itself, so every new page means editing the file again. As soon as the site grows a little, a plugin or an automatic generator pays off more.

How to submit the sitemap to Google Search Console

There are two ways for Google to know where your sitemap is:

  1. From the Sitemaps report in Google Search Console: you enter the file’s URL (for example, sitemap_index.xml) and Google processes it.
  2. By declaring a Sitemap: line in your robots.txt, with the file’s full URL. It is useful as a backup, or if you work with several search engines and not just Google.

One route that no longer works is the old “ping” endpoint (a URL like google.com/ping?sitemap=... that notified Google of a change).

Google announced its deprecation in June 2023 and, since the end of that year, those requests return a 404 error: it does not affect rankings, but if you have an old script or plugin still using it, it is not doing anything useful.

How to check that the sitemap is working properly

Submitting the sitemap is not the end of the process. In the Sitemaps report in Search Console you can see the status of each file submitted, whether Google was able to read it without errors, and a figure that often causes confusion: pages discovered versus pages indexed.

A URL being in the sitemap and having been discovered does not mean it will be indexed; Google decides that separately, based on the quality and relevance of the content. Checking this report reasonably often lets you spot early whether the sitemap is blocked by mistake in robots.txt, whether it contains URLs that return errors, or whether there is a large gap between what has been discovered and what has been indexed that deserves a look.

A sitemap without errors is also no guarantee that a generative AI assistant can read those pages properly: these are two different checks. The sitemap solves discovery by traditional crawlers; whether the content is accessible and readable (no blocks, not depending on JavaScript alone) is a separate layer.

If you want to check that part on your own site, the Parsigo technical crawling and indexing diagnostic checks the access and readability of your content for traditional and AI agents, without promising indexing or citation results: it just tells you, with data, what each crawler is (or is not) seeing.

Conclusion

A sitemap is not a compulsory formality for every website, but on large sites, sites that publish frequently or sites with weak internal linking, it genuinely helps Google discover and crawl your pages. If you have WordPress or another CMS with an SEO plugin, you probably already have one generated; if not, look at which generation option fits your project.

As a next step, go into Search Console, check whether your sitemap is submitted and error-free, and if there is a big gap between pages discovered and pages indexed, that is the signal to investigate beyond the sitemap.

Frequently asked questions about sitemaps

What exactly is a sitemap for?

It tells crawlers which URLs exist on your site and, if you include it, when each one was last updated. It makes discovery and crawling easier, but it does not guarantee indexing or improve rankings on its own.

How do you create a sitemap manually?

By writing an XML file with the root tag urlset and one url entry with its loc for each page. It is only practical on very small sites, because it does not update itself when you add new content.

How do I view the sitemap of a website, mine or someone else’s?

It is usually at paths such as /sitemap.xml or /sitemap_index.xml; you can also look for the Sitemap: line inside the domain’s robots.txt file, which normally points to it.

How do I submit my sitemap to Google Search Console?

From the Sitemaps report in Search Console, entering the file’s URL. You can also declare it in robots.txt with a Sitemap: line as a backup.

How do I know whether my site already has a sitemap?

Try visiting yourdomain.com/sitemap.xml or check robots.txt for the Sitemap: line. If you use WordPress with an SEO plugin, there is almost certainly one already generated automatically.

Is a sitemap compulsory?

No. It is especially useful on large sites, sites that publish frequently or sites with weak internal linking. On a small, well internally linked site, Google can crawl it fine without a sitemap.

Check it on your site

Finding out whether AI systems can read you takes a few seconds

We analyse several pages of your domain and tell you what the crawlers find. Free, no sign-up.

Keep reading

More on access

7 min

Google Search Console

Google Search Console is Google’s most reliable source on how it sees your site. What it is, what it is for and what each of its main reports measures.

Read