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.
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
Post a Comment