Sunday, December 6, 2026Online since 2014Articles, tutorials, software solutions and open source projects
Coding

Yet another optimized robots.txt file for WordPress (including all the latest Googlebots)

If you're unhappy with your robots.txt file you can try this one, which filters what you should hide without crippling any of the latest Googlebots.

There are a lot of self-declared "optimized" robots.txt files for WordPress around the web, but most of them don't allow full access to most Googlebots that scans our website for various reasons, such as: mobile browsers compatibility, PageSpeed insights, tag/structured data analysis, & more. Here's a list of all of them as of October 2016, including the most recent ones.

If you want to be sure that your robots.txt isn't blocking any of these, you can test your website URLs with the following tools:

If you're unhappy with the results, I strongly suggest to adopt something similar to the following:

INI
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: AdsBot-Google-Mobile-Apps
Allow: /
 
User-agent: Googlebot
Allow: /
 
User-agent: Googlebot-Image
Allow: /
 
User-agent: Googlebot-Mobile
Allow: /
 
User-agent: Googlebot-News
Allow: /
 
User-agent: Googlebot-Video
Allow: /
 
Sitemap: http://YOUR_SITEMAP_URL

IMPORTANT: Be sure to replace YOUR_SITEMAP_URL with your actual sitemap URL: if you're using WordPress+Jetpack, it should be something like www.yoursite.com/sitemap.xml.

That's it for now: happy SEO!

*/ ?>
*/ ?>
Share
Author

Ryan

IT Project Manager, Web Interface Architect and Lead Developer for many high-traffic web sites & services hosted in Italy and Europe. Since 2010 it's also a lead designer for many App and games for Android, iOS and Windows Phone mobile devices for a number of italian companies. Microsoft MVP for Development Technologies since 2018.

All articles by Ryan
Discussion

Comments

No comments.

Leave a comment

Your email address will not be published.


The reCAPTCHA verification period has expired. Please reload the page.

This site uses Akismet to reduce spam. Learn how your comment data is processed.

*/ ?>

Newsletter

New articles and product updates, by email.

We will ask you to confirm your subscription by email. You can unsubscribe at any time; your data is handled as described in the privacy policy.

{"prefetch":[{"source":"document","where":{"and":[{"href_matches":"/*"},{"not":{"href_matches":["/wp-*.php","/wp-admin/*","/wp-content/uploads/*","/wp-content/*","/wp-content/plugins/*","/wp-content/themes/monstrance-ryadel/*","/wp-content/themes/monstrance/*","/*\\?(.+)","/*ao_noptirocket*","/*jetpack=comms*","/*kinsta-monitor*","/*ao_speedup_cachebuster*","/*removed_item*","/my-account*","/wc-api/*","/edd-api/*","/wp-json*"]}},{"not":{"selector_matches":"a[rel~=\"nofollow\"]"}},{"not":{"selector_matches":".no-prefetch, .no-prefetch a"}}]},"eagerness":"conservative"}]}