Skip to main content

Add Sitemap to Robots.txt

How to Add Sitemap in Robots.txt File and Why it is Important

Today in this article I will tell you how to add sitemap in Robots.txt file and why it is important?

There are thousands of search engines in the world and it is not possible to submit your site to every search engine, but when you add your sitemap to Robots.txt file, you do not need to submit your site or blog to all search engines.

However, it is necessary to submit your site in Google and Bing.

Add sitemap Robots txt File, How to Add Sitemap to Robots.txt, How to Add Sitemaps to Robots.txt, Creating a Robots.txt file, Adding sitemap to robots


What is Sitemap and Robots.txt File


Sitemap is a list of all the URLs on your website and blog that tells the search engine about all the pages and posts URLs on your website. Sitemap does not improve your search ranking, but it allows search engines to crawl your website better.

Robots.txt file helps search engines understand which part of your site to index and which part not. When search engine robots visit your site, they follow the robots.txt file on your site and index the part that you want to be indexed in search engines.


Is it necessary to add sitemap in robots.txt file?


This is a question that all bloggers want to know that is it necessary to add sitemap in robots.txt?

The simple answer is – No.


Still why do we add sitemap in robots.txt file?

There are many search engines in the world and it is not possible to submit the site in each one, but when you add your sitemap in robots.txt file, then search engines can easily crawl and index your webpage URLs.


So let’s start adding sitemap to robots.txt file…


How to Add Sitemap to Robots.txt File

First, go to the root directory of your site and select the robots.txt file and add your sitemap URL by clicking on the Edit button.


Sitemap: http://www.example.com/sitemap.xml

Now your robots.txt file will look something like this.


Sitemap: http://www.example.com/sitemap.xml

User-agent: *

Disallow: /wp-admin/

Allow: /wp-admin/admin-ajax.php


Sitemap can be placed anywhere in the robots.txt file. It doesn’t matter where you place it.

How to Add Multiple Sitemap in Robots.txt File

You can see below,


Sitemap: http://www.example.com/sitemap_index.xml


User-agent: *

Disallow: /wp-admin/

Allow: /wp-admin/admin-ajax.php

Or, you can add different URLs for your multiple Sitemap files,

Sitemap: http://www.example.com/sitemap_host1.xml

Sitemap: http://www.example.com/sitemap_host2.xml

User-agent: *

Disallow: /wp-admin/

Allow: /wp-admin/admin-ajax.php

This way, you can manage your sitemap with the help of robots txt file. You can comment for any related to this article.

Today in this post you learned how to add your sitemap to your robots.txt file. If this article proved helpful for you, then don't forget to share it!

Comments

Popular posts from this blog

How to add domain in Blogger

Have you created your own free blog? And uploaded the theme on the blog, started posting blogs? And now want to know 'How to add custom domain in Blogger'? If your answer is "yes", then this tutorial is for you. In this article, you are told how to add custom domain in Blogger with steps and screenshots. You just have to buy a domain, and read this post thoroughly, then follow the steps and apply and add custom domain. So without wasting time, let's start with what is domain - What is Domain? Domain is the address of a web page, it is also called IP address. Basically, the domain name is a component of a URL (uniform resource locator), it is used to access a particular website. There are also levels of domain, such as Top-level, Second-level, and country-level etc. For example, https://www.knowledgetech.com is a top level domain, as its extension is “.com”. The first part of the domain is ‘Http‘ or ‘https‘, its full form is “Hypertext Transfer Protocol Secure”. Th...