Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to set up robots.txt file for WordPress

[UPDATE 2013]

I can't find an authoritative page with a format for robots.txt file for WordPress. I promise to maintain one on my site but I want one here on stack overflow.

If you know what your doing please check current draft here:

http://mast3rpee.tk/?p=127

Everyone else comment on this:

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: /feed/
Disallow: /comments/
Sitemap: http://domain.com/sitemap.xml
Crawl-delay: 4
like image 838
mAsT3RpEE Avatar asked Dec 21 '22 04:12

mAsT3RpEE


2 Answers

User-agent: *
Allow: /
Disallow: /cgi-bin
Disallow: /wp-admin
Disallow: /wp-includes
Disallow: /wp-content
Disallow: /e/
Disallow: /show-error-*
Disallow: /xmlrpc.php
Disallow: /trackback/
Disallow: /comment-page-
Allow: /wp-content/uploads/

User-agent: Mediapartners-Google
Allow: /

User-agent: Adsbot-Google
Allow: /

User-agent: Googlebot-Image
Allow: /

User-agent: Googlebot-Mobile
Allow: /

Sitemap: http://yoursite.com/sitemap.xml

I think this code is very authentic for robots.txt file, Just go to Public_HTML and create file with robots.txt and paste above code. You can make in your Notepad, just copy above code and paste into notpad but remember file name should robots.txt and upload to your public_HTML.

like image 186
Waqas Ahmed Avatar answered Jan 12 '23 23:01

Waqas Ahmed


As with all things SEO, things change. I think that the current advice is to have a a very minimal robots.txt file.

Ignoring wp-admin, wp-includes, wp-content, etc. may prevent Google from rendering pages correctly, which it doesn't like.

Check out this article by Yoast: https://yoast.com/wordpress-robots-txt-example/.

like image 29
kdev Avatar answered Jan 13 '23 00:01

kdev