Two minion toys facing each other, each holding a guitar as if in a musical duel.

What Should I Put in My Robots.txt File?

So what should I put in my Robots.txt file you might ask?

Good question and as with most things, “doctors differ, patients die” well maybe that’s a little bit extreme!

Read on a bit further to see your options and find the best code to suit your on website.

Optimizing WordPress Settings for Enhanced Performance and SEO

>>GUARANTEED Increase in Organic Traffic<<

Yoast’s Recommendation for Robots.txt

Yoast is an authority on SEO and you would do well to read their website.

Yoast’s SEO for WordPress Plugin is also a must for any website.

Recommended Reading

The recommendation from Yoast for the robots.txt file is very simple and as follows:

User-Agent: *
Disallow:

I have been using something similar for some time now, but I add a Disallow folder for all of my affiliate links, so mine used to read like this:

User-Agent: *
Disallow: /recommends/

What Should I Put in My Robots.txt File robot txt crazy

What is in My Robots.txt Now

So, after a lot of reading on the internet from my authorities on SEO, as usual, I have gone my own way and I am now using the following robots.txt:

User-agent: *
Disallow: /recommends/
Sitemap: https://www.brianhillier.co.uk/sitemap.xml

If you do not have affiliate links in a “/recommends/ separate folder, then all you need is:

User-agent: *
Disallow:
Sitemap: https://www.brianhillier.co.uk/sitemap.xml

Again, I use one xml sitemap and an html sitemap and you should list the one(s) you use as shown.

Why Include the Sitemap in the Robots.txt?

A lot of SEO authorities say it is not necessary to list the sitemap(s) in the robots.txt file, but in my digging around to find the best setup for SEO, I found this from sitemaps.org who as you would recognise are the absolute authority on sitemaps on the internet and they recommend the following:

You can specify the location of the Sitemap using a robots.txt file.

To do this, simply add the following line including the full URL to the sitemap:
Sitemap: http://www.example.com/sitemap.xml

This directive is independent of the user-agent line, so it doesn’t matter where you place it in your file.

If you have a Sitemap index file, you can include the location of just that file.

You don’t need to list each individual Sitemap listed in the index file.

You can specify more than one Sitemap file per robots.txt file.
Sitemap: http://www.example.com/sitemap-host1.xml

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

In my experience this strongly confirms that the sitemap(s) should be in your robots.txt file.

What Should I Put in My Robots.txt File? Hopefully It’s A Bit Clearer

I hope this help to clear up any confusion there might be out there as to what should I put in my Robots.txt file and by all means give it a test on your own website to see what a difference it makes to SEO traffic.

If you have any queries on the above, just get in touch.

Similar Posts

  • Fix Too Many Redirects Error WordPress Problems

    Fix Too Many Redirects Error WordPress Problems – this is something you might be totally unaware of, but can really badly affect the SEO of your website. I don’t know if you are like me or not, but when I come up with a new idea for my WordPress websites, I just have to carry…

  • Check Best PHP Version For Your WordPress Website

    Perhaps something you do not think of doing on a regular basis, but it is good practice to check best PHP version for your WordPress website. Things never stay the same in the on line world and there are updates for everything you use today. Optimizing WordPress Settings for Enhanced Performance and SEO Table of…

  • What is Anchor Text and Do I Need to Use It?

    What is Anchor Text and Do I Need to Use It? – What exactly is Anchor Text? Here is an example of anchor text within a sentence: Can you spot that this is the anchor text in this example. Yet, as users, we are able to see no more than the clickable area of the anchor…

  • What Are WordPress Pagination Archives Best SEO Settings?

    What Are WordPress Pagination Archives Best SEO Settings? I wonder how many times you have searched Google to find out the best settings for paginated archives for a WordPress website? Index, noindex, follow, nofollow? It is a topic that is well discussed and debated amongst the SEO community and there are a lot of differing…

  • Titles And Metas Posts And Pages Yoast SEO Best Settings

    Titles And Metas Posts And Pages Yoast SEO Best Settings – DONT LISTEN TO ANYONE ELSE EXCEPT YOAST! You may think that statement is a bit over the top, but it’s down to months of different trials, changes, tests, experiments; you name it and I have tried it. Optimizing WordPress Settings for Enhanced Performance and SEO…