Sitemap for the website

What is a sitemap and how to set it up. Common practices and example files.

Introduction

A sitemap is an html page of a site or a special xml file that contains links to all important pages of the site. Sitemap is similar to a book table of contents, it helps the visitor (human or search robot) to quickly find any page of the site, making the minimum number of transitions.

What are sitemaps

Search robots index the site gradually, starting from the main page. If the site has many levels of nesting of pages, then it will take a long time until all the pages of the site are indexed. To do this, you need to create a sitemap, where all links to the pages of the site will be indicated so that the robot does not waste time navigating through nesting levels. Sitemaps come in three variants: html, xml, and txt.

HTML Sitemap

An HTML sitemap is a page on a site that lists links. Usually these are links to the most important sections and pages of the site.

For a sitemap in the form of an html page, there are restrictions on the number of links on one page. If there are too many links on the page, then not all links may be indexed or the sitemap page may be excluded from search.

The HTML sitemap has a tree structure with expanded sections and subsections. Unnecessarily cumbersome HTML sitemaps are often decorated with graphic elements, CSS styles and supplemented with Javascript.

In fact, all links added to the footer and header html of the page, as well as in the body of the page, are a sitemap in html format.

XML Sitemap

If the site has a lot of pages, then it is necessary to place links to all pages in the sitemap in xml format.

Unlike html links, links in xml are complete and have all the data about the page, its url, nesting and weight. The html links are basically a graphic element for the users (visitors) of the page.

Sitemap xml is a special sitemap format that is defined by all popular search engines, where you can specify the relative priority and frequency of page updates. The content of the sitemap is mainly a recommendation for a search robot.

The sitemap xml has a specific syntax, the structure of the sitemap xml is:view file on github.

Required tags:

  • urlset is the parent tag where all url-addresses are placed.
  • xmlns is the namespace of the XML language.
  • url - information about a specific url.
  • loc - Specifies the url.

Optional tags:

  • lastmod is the date the page was last modified.
  • changefreq How often the page changes: always, hourly, daily, weekly, monthly, yearly, never.
  • priority – page priority, to other pages of the site: 0.1 - low, 1 - high.

For separation in the sitemap, you must specify several links to different map files: view file on github

Additional required tags:

  • sitemapindex – contains the addresses of all sitemaps.
  • sitemap – encloses the options for each sitemap.

TXT Sitemap

Another way to design a sitemap as a file can be a sitemap in txt format. The sitemap.txt file lists all the necessary links line by line: view file on github

Page priorities

The priority of a page is set relative to other pages and the magnitude of the value does not matter here. This is a kind of order of positions, 1 is the first, 0.1 is the last, and everything between zero and one is intermediate positions.

A higher priority is set for those pages that are promoted for queries and a lower priority for those that can compete with landing pages for the same queries. For example, you can set priorities as follows:

  • 1 - the main page of the site.
  • 0.8 - main sections.
  • 0.6 - 0.5 - categories and subcategories.
  • 0.4 - to the end pages.

Creating a sitemap

Creating a sitemap is an important process in which it is necessary to clearly indicate which pages of the site should be indexed and how best to index them. Depending on what type of sitemap we are talking about, different methods of creating a sitemap are used.

There are several basic ways to create a sitemap, but they all have one thing in common: where the sitemap is located and how the sitemap is determined by search engines.

Search engines are able to find the sitemap file on their own. But there are several ways to provide a direct link to the sitemap file(s) for faster discovery by search engines.

The first way is to directly specify a link or several links to sitemap files in the Google webmaster tool google search console where you can check the site map, analyze the site map for the correctness and compliance of which pages from the site maps were found by the search engine and how many of them are indexed.

The second way is to point search engines to the location of the sitemap file in robots.txt: Sitemap: https://mysite.com/sitemap.xml.

You can specify several sitemap files in robots.txt, after which it will be automatically added to webmaster tools.

Creation methods

  • Site map generation using the site management system (CMS).
  • Download a sitemap from a third-party online service. There are many online sitemap generators with different capabilities and limitations. The xml-sitemaps.com resource has the ability to configure sitemap parameters.
  • Automatic creation of a sitemap sitemap: gulp, webpack, angular, react, vue and etc. To do this, you must use the necessary and workable plugins (add-ons). For example, generating a sitemap using gulp-sitemap.
  • Creating a sitemap manually.

Share it!

Hey, help me and share that page! Just only one click!