Implementing an effective SEO robots.txt file for WordPress will help your blog to rank higher in Search Engines, receive higher paying relevant Ads, and increase your blog traffic. Using a robots.txt file gives you a search engine robots point of view… Sweet!
WordPress robots.txt SEO
AskApache.com robots.txt files
For instance, I am disallowing /category/ in the robots.txt file below because askapache.com/category/htaccess/ is the same as askapache.com/htaccess/, and that would be duplicate content. Adding a 301 Redirect using mod_rewrite or RedirectMatch can further protect myself from this duplicate content issue.
www.AskApache.com/robots.txt
User-agent: * Disallow: /cgi-bin Disallow: /wp-admin Disallow: /wp-includes Disallow: /wp-content/plugins Disallow: /wp-content/cache Disallow: /wp-content/themes Disallow: /trackback Disallow: /comments Disallow: /category/*/* Disallow: */trackback Disallow: */comments Disallow: /*?* Disallow: /*? Allow: /wp-content/uploads # Google Image User-agent: Googlebot-Image Disallow: Allow: /* # Google AdSense User-agent: Mediapartners-Google* Disallow: Allow: /* # Internet Archiver Wayback Machine User-agent: ia_archiver Disallow: / # digg mirror User-agent: duggmirror Disallow: / # Does anyone care I love Google Apache htaccess Sitemap: http://www.askapache.com/sitemap.xml
z.AskApache.com/robots.txt
User-agent: * Disallow: Allow: /* User-agent: ia_archiver Disallow: / User-agent: duggmirror Disallow: /
Google Recommendations
Use robots.txt - Webmaster Guidelines
Make use of the robots.txt file on your web server. This file tells crawlers which directories can or cannot be crawled. Make sure it’s current for your site so that you don’t accidentally block the Googlebot crawler.
Eliminate Duplicate Content
Duplicate content generally refers to substantive blocks of content within or across domains that either completely match other content or are appreciably similar. Mostly, this is not deceptive in origin. Examples of non-malicious duplicate content could include:
- Discussion forums that can generate both regular and stripped-down pages targeted at mobile devices
- Store items shown or linked via multiple distinct URLs
- Printer-only versions of web pages
However, in some cases, content is deliberately duplicated across domains in an attempt to manipulate search engine rankings or win more traffic. Deceptive practices like this can result in a poor user experience, when a visitor sees substantially the same content repeated within a set of search results.
Google tries hard to index and show pages with distinct information. This filtering means, for instance, that if your site has a “regular” and “printer” version of each article, and neither of these is blocked in robots.txt or with a noindex meta tag, we’ll choose one of them to list. In the rare cases in which Google perceives that duplicate content may be shown with intent to manipulate our rankings and deceive our users, we’ll also make appropriate adjustments in the indexing and ranking of the sites involved. As a result, the ranking of the site may suffer, or the site might be removed entirely from the Google index, in which case it will no longer appear in search results.
Prevent page from being indexed
Pages you block in this way may still be added to the Google index if other sites link to them. As a result, the URL of the page and, potentially, other publicly available information can appear in Google search results. However, no content from your pages will be crawled, indexed, or displayed.
To entirely prevent a page from being added to the Google index even if other sites link to it, use a noindex meta tag, and ensure that the page does not appear in robots.txt. When Googlebot crawls the page, it will recognize the noindex meta tag and drop the URL from the index.
Prevent content being indexed or remove content from Google’s index?
You can instruct us not to include content from your site in our index or to remove content from your site that is currently in our index in the following ways:
- Remove your entire website or part of your website using a robots.txt file.
- Remove individual pages of your website using a robots meta tag.
- Remove cached copies of your pages using a robots meta tag.
- Remove snippets that appear below your page’s title in our search results and describe the content of your page.
- Remove outdated pages by returning the proper server response.
- Remove images from Google Image Search using a robots.txt file.
- Remove blog entries from Google Blog Search.
- Remove a feed from our user-agent Feedfetcher, which provides content to our feed readers.
- Remove transcoded versions of your pages (pages we’ve reformatted for mobile browsers).
Google User-agents
- Adsbot-Google
- crawls pages to measure AdWords landing page quality
- Googlebot
- crawl pages from googles web and news index
- Googlebot-Image
- crawls pages for the image index
- Googlebot-Mobile
- crawls pages for the mobile index
- Mediapartners-Google
- crawls pages to determine AdSense content
Good Robots.txt Articles
- How Google Crawls My Site
- Using the robots.txt analysis tool
- Controlling how search engines access and index your website
- Controlling Access with robots.txt
- Removing duplicate search engine content using robots.txt - Mark Wilson
- Revisiting robots.txt - Twenty Steps
Robots Meta Tags
Robots Meta Examples
Stop all robots from indexing a page on your site, but still follow the links on the page
<meta name="robots" content="noindex,follow" />
Allow other robots to index the page on your site, preventing only Googles bots from indexing the page
<meta name="googlebot" content="noindex,follow" />
Allow robots to index the page on your site but not to follow outgoing links
<meta name="robots" content="nofollow" />
header.php Trick for Conditional Robots Meta
Add this to your header.php
<?php if(is_single() || is_page() || is_category() || is_home()) { ?>
<meta name="robots" content="all,noodp" />
<?php } ?>
<?php if(is_archive()) { ?>
<meta name="robots" content="noarchive,noodp" />
<?php } ?>
<?php if(is_search() || is_404()) { ?>
<meta name="robots" content="noindex,noarchive" />
<?php } ?>
Robots.txt footnote
Alexa, Compete, and Quantcast are all guilty of firewalling unknown friendly search engine agents at the front gate. These sites that monitor the Internet should be the most in the know that unfriendly agents cloak as humans and will come in no matter what. So the general rule of thumb is that robots.txt directives are only for the good agents anyway.
Robots.txt References
- Robots.txt optimization
- The Web Robots Pages
- W3.org - Notes on helping search engines index your Web site
- Wikipedia robots.txt page
- Inside Google Sitemaps: Using a robots.txt file
wordpress seo robotstxt robots traffic rank
Related Articles

08.12.07 at 8:21 pm
I usually use these codes:
User-agent: *
Disallow: /cgi-bin
Disallow: /wp-*
I think I need some change.
Thanks 4 your post:)
08.16.07 at 12:19 pm
is it good to have the tag cloud crawled. since it is a way of humanly categorizing content?
I hear this is good, but should I then block my original wordpress categories?
08.16.07 at 5:45 pm
If I have 10 pages website, Do we need to add Robots index,follow on each page?
Or I need to add this only on index or default page so that robots can follow all links from there?
Also what will happen if robot lands on a inner page first? does this line helps re-directing robot to follow links from index page?
08.18.07 at 9:48 am
Il file robots.txt per una indicizzazione migliore aggrego alla discussione (perch� interessa anche a me :P ). Su askapache consiglia: User-agent: * Disallow: /cgi-bin Disallow: /wp-admin Disallow: /wp-includes Disallow: [...]
08.20.07 at 9:41 pm
great list, thanks!
08.23.07 at 12:17 am
Thanks for the great sharing, I am studying it now and plan to implement to all my blog sites.
09.15.07 at 3:05 am
Nice writeup. Thnx
09.17.07 at 12:12 pm
Hello, my robots.txt is the following
My issue is that my post only ranks when are on the homepage, is something wrong with my robots.txt ??? I´m ussing the same robots.txt on other two blogs and ranks really well
09.17.07 at 12:33 pm
Why you are not disallowing /2007, /author and /page ???
10.24.07 at 10:13 pm
I fixed it. I put it in my root directory!
11.01.07 at 11:00 pm
Great stacey!
@ cosasdeviajes
I fixed it so that now it disallows
/2007and/authorand I’m allowing/pagein myrobots.txtso that bots can still follow the links on /page* but they will not be indexed. This makes sure that they don’t use up any link-juice on my site and also helps search engines find more interlinking between my main content, single pages.11.12.07 at 5:38 pm
Hay que limitar aceso a la carpetas para lascuales nos interesa limitar el rastreo, sin embargo cuidado en no occurir en el Blackhat, algunos manipulan los CSS, y limitan el aceso al buscador para que no se de cuenta de la adaptacion de los H1…Hx…
yo propongo uno como :
http://www.vuelomania.com/robots.txt
12.09.07 at 1:08 pm
[...] bloquear por medio de robots.txt la entrada del buscador a las secciones que duplican el contenido (uso avanzado), pero al parecer (comprobación mediante pruebas realizadas) Google está realizando un excelente [...]
12.11.07 at 6:26 pm
[...] See the Updated WordPress robots.txt file [...]
01.09.08 at 4:40 pm
Thanks for the post, it’s really useful!
But could you please tell more about following strings:
What do they mean? Is there any difference between “
Allow: /*” and “Disallow:“?And how I should disallow indexing of a particular directory: “
Disallow: /wp-admin” or “Disallow: /wp-admin/“? (should I use slash at the end or not?)01.10.08 at 2:02 am
[...] create a txt file using NotePad, WordPad, TextPage, etc.. and name it robots.txt. From there, visit this page to learn about how you can quickly start adding instructions to [...]
01.17.08 at 11:32 am
Hi Matt,
I am not handy in Robots.txt file, but would i block whole pages from search engines incase if i use both your sample robots.txt file and php codes that you provided for Wordpress.
01.21.08 at 5:58 pm
I’m not sure what you are asking mehmet, but all the information you need is on this page.
02.08.08 at 5:21 pm
I was wondering why the robots.txt file in this example is different to the one at askapache.com/robots.txt
nice blog btw.
02.17.08 at 12:23 pm
May I please ask you why you put this line :
Disallow: */comments
I guess it is to prevent specific comment URL from being indexed but the format of the comments URL isn’t like this, isn’t it?
04.20.08 at 5:47 pm
@Olivier~
Well its because otherwise a search for askapache on google might list urls like http://www.askapache.com/this-seo-post/great-url.html#comment-232497 which is what it means to have a URL indexed in a search engine.
I have about 230 posts on this blog, all high-quality, and coincidentally I have about 240 urls indexed by Google and major search engines. So it really makes my good pages the center of attention.