Robots.txt file: How to add your Sitemap to the Robots.txt file

robots.txt file with YOAST

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.

Also, see
Digital Marketing overview, and why you need it in your small business

Why WordPress is the best CMS for Search Engine Optimization

Why business cards are useless in promoting your business?

Google to train Ugandan Youths in Digital skills

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.
    robots.txt 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…

robots.txt file

After Adding your Sitemap…

robots.txt file





Written by 

Am Dhikusooka Brian a web app developer and an SEO Specialist at Interlet Limited. I am a writer at Cyclone Times Uganda and I love doing research so much. CONTACT ME ON +256701085038 OR +256775427530

Related posts

Leave a Comment