A sitemap is a file that lists the pages of a website and makes them known to search engines, helping them discover the pages and understand the site structure. In its most common form, the file is written in XML format and contains a set of addresses (URLs) accompanied, optionally, by additional information such as the date of the last modification, the update frequency and the relative importance of each page.
Sitemaps do not guarantee that content will be indexed, but they are a valuable aid for crawling, especially on large sites, new sites or sites with pages that are poorly linked to each other. There are also sitemaps designed for other types of content, such as images, videos and news, as well as a simpler text format for listing addresses.
What a sitemap is and what it is for
The main purpose of a sitemap is to tell search engines which pages exist on a site and how they are organized. When a site is very large, or when pages can only be reached through complex paths, a sitemap provides an ordered list that makes the work of crawling programs easier.
The difference between an XML sitemap and an HTML page
It is important not to confuse the XML sitemap with the site map page intended for visitors. The first is a file designed for search engines, the second is a navigable page that helps users find their way around. Both can coexist and serve different purposes.
The XML sitemap follows a precise schema, with a root element that contains one or more addresses. The HTML page, on the other hand, is built like any other page on the site and has no particular format constraints.
What a sitemap looks like
An XML sitemap contains a list of addresses, each enclosed in a dedicated block. For each address, some optional fields may appear that describe its characteristics. The format is standardized and is recognized by the main search engines.
The main fields of an address
The most common fields associated with an address are the date of the last modification, the frequency with which the page is updated and a relative priority. These values are indications and do not oblige search engines to behave in a specific way.
Priority does not affect the position in the results: it only serves to signal which pages are considered more relevant within the site. The update frequency is also a suggestion, not a constraint.
The size limit and the sitemap index
A single sitemap cannot contain an unlimited number of addresses and cannot exceed a certain size in bytes. When these thresholds are exceeded, a sitemap index is used, that is, a file that lists several separate sitemaps.
This arrangement makes it possible to manage very large sites by splitting the list into several files, each of which stays within the required limits. The index acts as a connection point and is reported to search engines in place of the individual sitemaps.
Types of sitemaps and formats
In addition to the generic XML format, there are sitemaps specialized for specific content. Image sitemaps list the images present on the pages, video sitemaps describe audiovisual content and news sitemaps collect recent articles from news outlets.
There is also a simple text format, in which each line contains a single address. This format is more limited, because it does not allow information such as the modification date to be added, but it can be useful in very simple contexts.
| Type | Content listed | Typical fields | Main use |
|---|---|---|---|
| Generic XML | Site pages | Date, frequency, priority | Sites of any size |
| Images | Images on the pages | Image address, caption | Sites rich in visual content |
| Video | Audiovisual content | Title, duration, description | Platforms and multimedia sites |
| News | Recent articles | Title, publication date | News outlets |
| Text | List of addresses | No additional fields | Simple cases and quick checks |
How to create and publish a sitemap
A sitemap can be created in several ways. In the most common content management systems there are add-ons that generate the file automatically; alternatively, a developer can produce it with a dedicated procedure. The file must then be published on the site, usually in the root directory.
After publication, it is advisable to report the sitemap address to search engines, for example by inserting it in a dedicated instructions file or by communicating it directly through the tools provided by the search engines themselves.
- List all the pages you want to include, excluding duplicate or unwanted ones.
- Choose the format best suited to the type of content on the site.
- Generate the file following the schema required by the chosen format.
- Check that the addresses are correct and complete.
- Check that the file does not exceed the size and address count limits.
- Publish the file in an accessible location on the site.
- Report the sitemap to search engines through the available tools.
- Update the file periodically when you add or change pages.
Common mistakes and best practices
A frequent mistake is to include in the sitemap pages that should not be indexed, such as internal screens or duplicate content. It is also inadvisable to list addresses that return errors, because this can create confusion in crawling programs.
Another good practice is to keep the sitemap up to date: an outdated file, which lists removed pages, loses much of its usefulness. Finally, it is worth avoiding an excessive number of low-relevance addresses, focusing instead on the pages that really deserve to be discovered.
Frequently asked questions about sitemaps
Does a sitemap guarantee that pages will be indexed?
No. The sitemap helps search engines discover addresses, but it does not ensure that they will be indexed. Indexing depends on many other factors, including content quality and the search engines’ internal rules.
Where should a sitemap be published?
As a rule it is placed in the root directory of the site, so that it is easy to reach. It can, however, be located anywhere, as long as the address is correctly communicated to search engines.
What is the difference between a sitemap and an instructions file for search engines?
The instructions file tells search engines which parts of the site to crawl and which to exclude. The sitemap, on the other hand, lists the pages to be discovered. They are complementary tools and are often used together.
How many pages can a sitemap contain?
There is a maximum limit both on the number of addresses and on the file size. When the site exceeds these thresholds, an index is used that collects several separate sitemaps.
Does a small site need a sitemap?
It is not mandatory, but it can be useful even for small sites, especially if the pages are poorly linked to each other. In many cases search engines can still discover them through internal links.
How often should a sitemap be updated?
There is no fixed rule: it is worth updating it every time important pages are added, changed or removed. For sites that change often, automatic updating is the most practical solution.
Related entries:
Sitemap example SEO sitemap Sitemap Create XML sitemap XML sitemap
