Skip to content

Instantly share code, notes, and snippets.

@ericrasch
Last active July 4, 2017 03:52
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save ericrasch/6073660 to your computer and use it in GitHub Desktop.
Save ericrasch/6073660 to your computer and use it in GitHub Desktop.
Robots.txt files for sites with WordPress.
User-agent: *
# Changing the /feed back to include the trailing slash since it otherwise blocks URLs like http://www.thesimpledollar.com/feeding-my-sweet-tooth-without-breaking-my-belly-or-breaking-the-bank/
Disallow: /feed/
Disallow: /cgi-bin
Disallow: /wp-admin
Disallow: /wp-content/cache
Disallow: /wp-includes
Disallow: /trackback
Disallow: /xmlrpc.php
Disallow: ?wptheme=
Sitemap: http://www.yourwebsite.com/sitemap_index.xml
@ericrasch
Copy link
Author

After testing with the Google Webmaster Tools, you need to leave off the trailing slash on folders. So, a rule like Disallow: /feed will get both /feed/ and /feed covered by the rule.

@ericclemmons
Copy link

Nice catch!

@ericrasch
Copy link
Author

Changing the /feed back to include the trailing slash since it otherwise blocks URLs like http://www.thesimpledollar.com/feeding-my-sweet-tooth-without-breaking-my-belly-or-breaking-the-bank/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment