For the site to work for you and your business, you need to work in detail on many of its components. Visibility on the Internet can be provided in different ways, for example, by engaging in SMM promotion on social networks or ordering paid advertising. But one of the main ways to present the site to potential customers is still indexing pages in search engines.
You can have a perfectly designed platform with many functions and a well-designed interface prepared by a professional UX/UI designer. You can regularly publish expert articles filled with keywords according to all SEO canons, use plugins to optimize and correctly spell out metatags. But there is another factor that must be taken into account - this is the sitemap.xml file. Experienced webmasters know what it is. And if you are now just creating your own site and have not heard about Sitemap, this article is for you.
What is sitemap.xml?
Sitemap.xml is a site map that identifies all pages that require indexing in search engines. Actually, it is a file with a list of references with the .xml extension. By the way, you can create a site map in the form of a text file (.txt), but we will talk about it a little bit later.
Sitemap.xml is designed exclusively for search engines. With its help, robotic systems will be able to see which pages need to be indexed, their priority, and the last update date.
What are the components of sitemap.xml and what does it look like?
The site map looks like a list of tagged links. The sitemap.xml file should always indicate the location of the page. Optionally, you can specify the refresh rate and priority.
Let's try to model the site map. Let's say you have a simple one-page site. If you create the simplest version of a website map in a notebook yourself, it will look like this:
<urlset>
<url>
<loc> of https://name-of-your-site/main </loc>
</url>
</urlset>
Here <urlset>, <url>, and <loc> are essential tags.
But you can also add the page refresh rate and the time of the last change. Then the site map will look like this:
<urlset>
<url>
<loc> https://name-of-your-site/main </loc>
<lastmod>2019-11-11T03:30:01+01:00</lastmod>
<changefreq>daily</changefreq>
</url>
</urlset>
Let's take a closer look at the newly introduced attributes:
- <lastmod>. Indicates when the page was modified last time.
- <changefreq>. Specifies the frequency of page changes. Our example indicates 'daily', which means a daily change. You can set any frequency, for example, hourly, monthly, yearly, or constant, that is, each time a person clicks a link. You can also specify that the page never changes (never). This option is suitable for old pages in the archive that search engines will still index.
So, you have decided to create another page for your blog. You can now prioritize them. With its help, the search robot will rank the pages according to the priority you set. For this, there is a scale in which the minimum priority is 0.1, the maximum is 1. If you do not determine the priority yourself, the search engine will do it for you, and the priority of each page will be 0.5.
Here is how website map will finally look:
<urlset>
<url>
<loc> of https://name-of-your-website/ </loc>
<lastmod>2019-11-11T03:30:01+01:00</lastmod>
<changefreq>daily</changefreq>
<priority>1</priority>
</url>
<url>
<loc> of https://name-of-your-website/blog </loc>
<lastmod>2020-10-10T03:30:01+01:00</lastmod>
<changefreq>daily</changefreq>
<priority>0.6</priority>
</url>
</urlset>
The < priority > attribute is responsible for the priority. Based on this code, the search engine will consider the main page of the site to be of a higher priority than the blog.
But there is a second option. If the site map is a text document with the .txt extension, the links will simply go in a column. In this case, the file will be called sitemap.txt, and it will look like this:
- https://name-of-your-website/main
- https://name-of-your-website/blog
You can use this option for a single page site. But sitemap.xml is the only option suitable if you want to specify the frequency of updates or select more priority pages.
Are there any restrictions for sitemap.xml?
There are some restrictions. Those are the following:
- The number of links. In total, up to 50 thousand links are allowed in a single file.
- File size. The file cannot be bigger than 50 MB.
- Location. The file is placed in the root folder. The main nuance is that the site map should be in the same catalog as the links indicated in it. For example, the file is located at https://name-of-your-website/catalog/sitemap.xml. So, it cannot contain the link https://name-of-your-website/blog, but it can contain a link like https://name-of-your-website/catalog/blog. And if the site map is located at https://name-of-your-website/sitemap.xml, then you can specify any page that has the same domain.
- Domain. Another limitation comes from the previous paragraph. The site map domain and all links in it must be the same. You cannot specify the address https://another-site in the file under the link https://name-of-your-website/sitemap.xml.
- Protocol. If the link to the site map looks like https://name-of-your-website/sitemap.xml, then the addresses specified in the file must have https protocol. In this case, the following is correct: https://name-of-your-website/home, and the following is not: http://name-of-your-website/home.
The site map must also be entered in the robots.txt file. To do this, simply add a line with the file address. In the example we describe in this article, it will look like this:
Sitemap: https://name-of-your-website/sitemap.xml
So robotic systems will be able to find the map of the site, which is the purpose of its creation.
How to create sitemap.xml?
If your site is a business card that includes 3 pages, you can create a site map manually. For such resources, a text file with a list of links will be enough. For large resources, this option is not suitable. But routine actions are easy to automate. To do this, you can use one of the following:
- Site map generator in CMS. If you use a content management system, the site map will be generated automatically.
- Third-party site map generator. If you do not use the content management system, or you have your own engine, you can use the sitemap.xml generator. You can find lots of such offers on the Internet, so it's possible to easily choose a resource with good reviews. For small and simple sites there are free versions of generators. And if there are hundreds of thousands of pages on your resource, then you will have to pay a small amount that equals $2. To keep the site map up-to-date and dynamic, some service providers offer monthly rates. Expenses in this case will not be large and are unlikely to exceed $5/month. There are more expensive programs that cost from $20, so the price needs to be specified.
- Plugin. The site map can be generated using the SEO plugin. For example, YoastSEO. This is the most popular plugin for the SEO-optimization of sites on WordPress. You can also use narrow-directional plugins, for example, Google XML Sitemaps. It generates a file automatically, after which you only need to send a link to it to Google Search Console. We have already written about them in more detail when we were discussing SEO plugins for WordPress.
You can also create your own script to generate a site map if you do not want to use ready-made solutions.
To what extent does a site map affect its indexing in search engines?
We don't claim confidently that the presence of the sitemap.xml file alone will bring your resource to the top search results. Nevertheless, the site map is an important component of it. It simplifies scanning your resource with search robots. So, it works as a hint for search engines.
Our verdict is the following: the presence of sitemap.xml does not always bring pages to the first lines in search results, but it certainly helps them not to fall to the last. That is, you cannot do without it, especially if you are seriously engaged in promoting your website.Besides, you can't do without good hosting. If your resource lacks virtual hosting resources already, and you are looking for more powerful options, we recommend paying attention to the virtual servers from King Servers. We offer VPS/VDS hosting services and several rates based on the needs of your site. Write to us to choose the best option for yourself!