Robots.txt file: How to add your Sitemap to the robots.txt file
In this article, I clearly show you how you can add a Sitemap to the Robots.txt file using YOAST SEO plugin. It’s beyond a reasonable doubt that all website owners want their websites to rank high on the Google search Engine. However, the most important thing is to have your website pages to be crawled and indexed by the search engine bots.
The Robots.txt file and the XML Sitemap are the two different files that help to provide these bots with the information they need quickly. In addition, and effectively crawl your website.
What is a robots.txt file in the first place?
This is a basic text file located within the root directory of your website. Therefore this file contains contents that help the let the search engine robots crawl and also ensure permissions for particular search engines supposed to crawl your site.
This is, however, one of the most important files on your website because if a search engine bot enters your site, It immediately looks for the robots.txt file. In addition, even before doing anything.
Where do I create a robots.txt file for my site when using YOAST SEO?
To successfully create a robots file for your website, follow the following steps:
- Go to your WordPress dashboard, Click on tools under the YOAST SEO settings.
- After that, click on the file editor. This tool allows you to quickly change important files for your SEO for example, robots file, and the .htaccess file.
- Click on create robots.txt file for your website.
How Do I Add a Sitemap to the Robots.txt file?
After you have created the robots file, add your Sitemap to the robots.txt file by editing it.
But where do I locate my Sitemap for my website?
If you are using YOAST SEO, it’s very easy to locate a sitemap for your Website.
- Click on the general setting for the YOAST SEO plugin.
- Then Click on Features
- Scroll down and select the question mark on XML site maps, however, make sure your XML sitemaps button is on. In addition, click on the see the XML sitemap link as shown in the picture below.
- After you have clicked on the above link, you will be redirected to a new page where you will find your Sitemap. For example, your URL will be yourdomain/sitemap_index.xml
Now we have a Sitemap for our website, let’s add it to the robots file.
Before adding a sitemap, our robots file looks like this…
After Adding your Sitemap…
11,907 total views, 6 views today