How To Change And Use Robots.txt In WordPress Blog

| November 23, 2009 | Comments (20)

changing-your-robots-txtFrankly many of us are not even aware that there is something called robots.txt and what it does and what is the importance of using robots.txt in your blogs and websites.

Infact its not a compulsion that you need to have a robots.txt in your blog, in fact you don’t need one but still if you want to pass on any special instructions to search engine spiders then robots.txt is a must have file on your server, in this article we will see how you can effectively utilize this text file for your wordpress blogs when you want to pass on any special instructions to search engines.

First thing a search engine spider looks for when it reaches a site or blog is robots.txt file to see if there is any special instructions, instructions may be like you may not want search engines to crawl some parts of your blogs or some sections of your blog and these kind of instructions can be passed to search engine spiders with this file. But mostly you won’t be able to locate this file through your ftp program, so if you want to access your robots.txt file from your admin panel and alter it then you must use this plugin called KB Robots also this plugin is of any use only if your blog is hosted in the root of your server not to some other directories like say www.yourdamin.com/blog if that is the case create your custom robots.txt file in your machine and upload it to the root of your server most cases under public_html folder

WordPress comes with a default robots.txt file that looks like this
User-agent: *
Disallow:

What does this mean? it means allow all the search engine bots to crawl through your entire blog without any exception.

To ban all the search engine bots from crawling through your entire blog you can use this code.
User-agent: *
Disallow: /

This will ban all the search engine bots from crawling any parts of your blog and will stay away from your blog which of course we don’t want.

You can object specific bots from crawling your webpages like Googlebot or Msn bot then you can pass that instruction to that specific bot like this.
User-agent: Googlebot
Disallow: /

In the code above we have asked Googlebot to stay away from the site, you can find the list of robots here

To allow only specific bots and ban others then you can do it like this.

User-agent: Googlebot
Disallow:

User-agent: *
Disallow: /

To disallow specific sections of your blog from being crawled then you can pass the instruction by using the code like this.

User-agent: *
Disallow: /archives/

you can substitute the archives with whatever you want, if you don’t want specific category not to be crawled then replace it with that category name and that category will not be indexed and crawled by search engines.

This is a copy of my robots.txt you can access it at http://seoyourblog.com/robots.txt

you can see even google uses a robots.txt file http://google.com/robots.txt almost all the websites on the internet uses robots.txt file and you can access this file by adding a robots.txt at the end of their domain.

Tags: ,

Category: Blog Seo

About admin: runs and maintains seoyourblog.com, he has written many articles concerning various topics including blogging, SEO and wordpress SEO. Feel free to subscribe to our RSS Feeds to receive the latest post updates. View author profile.

  • http://me.atoqa.com/ Babyblogger

    hi, thanks for your post. i faced this problem..I noticed that my traffic only come from links from other blogs/websites..not from search engine..then i change the robots.txt file using PC Robots.txt

    how to know whether our blog has been indexed by search engine? Is it by checking it from the google webmaster tools again?

    thanks.
    .-= Babyblogger´s last blog ..Letak navigation link pada post =-.

    • seoguy

      You can do a search in Google with site:yoursiteurl.com it will display all the pages that are indexed by Google and yes webmaster tools is another way to know the number of indexed pages.

  • http://ghoulcostumes.org Vijay

    Hi,

    Have spent quite sometime on your site today.

    And have found quitea few of interest to me.

    This is one such.

    My queries for this post are:

    1. When you say

    User-agent: *

    does it not cover googlebot also?

    If yes, why not add the one additional line that is under googlebot viz.

    Disallow: /*&ref

    under this specification and be done with it?

    2. Would you suggest having comments in the post(s) also to be kept out of the search engines way?

    If yes,

    what would be the statement for that?

    Disallow: /*comments ?

    Would appreciate your response.

    Thanks

    Vijay

    • http://seoyourblog.com Chakkravarthi

      “My queries for this post are:

      1. When you say

      User-agent: *

      does it not cover googlebot also?”

      Yes it does.

      I do not understand this part of the question

      why not add the one additional line that is under googlebot viz.

      Disallow: /*&ref

      I really do not get what you really mean. makes no sense to me.. can you elaborate the question?

      2. 2. Would you suggest having comments in the post(s) also to be kept out of the search engines way?

      If yes,

      what would be the statement for that?

      Disallow: /*comments ?

      you got it right.. :D

      • http://ghoulcostumes.org Vijay

        Hi,

        Thanks for your response.

        1. Re: Disallow: /*&ref

        what I meant was,

        this is the only additional statement appearing specifically under

        User-agent: Googlebot

        and since you agree

        User-agent: *

        covers googlebot also,

        why not list the one additional statement

        Disallow: /*&ref ( under User-agent: Googlebot )

        under User-agent: * itself

        and get rid of

        User-agent: Googlebot and everything listed under it?

        Hope I am clear.

        2. Would you recommend keeping all bots out of

        – Comments and
        – Trackback

        Would it hurt in anyway?

        Thanks

        Vijay

        • http://seoyourblog.com Chakkravarthi

          some webmasters do use it to give specific instructions to specific bots. So its not uncommon to see such instructions in robots.txt.

          for the second part of the question. Well it depends. Some people claim that they get traffic from the comments in their post and some do claim that comments on a post spoils the keyword density in the main content. Both group of people do have some truth about what they claim. So its up to you to decide which one to opt for, same goes for trackbacks. I personally donot think these factors do influence your rankings much or do not influence at all.

  • http://www.nitgreen.com/ Web Guru

    In my opinion, We can use it for Restricting some pages which we don’t want that Google Crawl or Index.

    Otherwise there is no use of it.

  • http://www.seosally.com Seo

    Great help with the robots.txt. Thank you for the informative post.

  • Kiran

    Hello,

    Is there any solution for wordpress.com blogs? I mean i want to place robot.txt in archive. Is it possible?

    • http://seoyourblog.com Chakkravarthi

      I do not think you have the access to change robots.txt with wordpress.com blogs, how ever you can choose to stay away from search engines indexing your site through privacy settings.

  • http://www.pakeshop.com/ SEND GIFT TO PAKISTAN

    Well its really an amazing article regarding the wordpress blog. There are so many things that I didnt know before I went through the article. Now my concepts are clear about robot.txt.

  • http://www.pakeshop.com/ MOBILES SHOPS IN PAKISTAN

    robot.txt is a bit complicated but the article is a great help for understanding the concept reagrding wordpress robot.txt. Nice effort and good research work. Keep it up.

  • http://www.pakeshop.com/ MOBILES SHOPS IN PAKISTAN

    well using the robot.txt has always been a mess for me on wordpress blog but this piece of writing has helped me a lot to undertsnad how to chnage and use them. Now things are quite easier for me.

  • http://exclusive.com.pk/ PARTY WEAR

    Great help to make a robot.txt, very clear and informative post, thanks
    for this use full information

  • http://www.pakdelivery.com/ birthday gifts to pakistan

    after reading this post, i understand clearly what is robot.txt,
    this information very help full for me, thank u so much.