• Austin SEO
    • About TastyPlacement
    • TastyPlacement in the Press
    • Meet the Team
  • Blog
  • Services
    • SEO Services
      • WordPress SEO Service
      • Magento SEO Services
      • Conversion Rate Optimization
      • SEO Audit Service
      • Why Google Certification Matters
      • ChatGPT SEO & AI SEO Service
    • PPC & Google Ads
      • Google Ads & PPC Management
      • Remarketing Services
      • Display Ad Management
      • Facebook Ad Management
      • Google Ad Grants Management for Non-Profits
      • Adwords App Install Ad Management
      • Product Listing Ad Management
    • Analytics & Data
      • Analytics and Monitoring
      • Google Tag Manager Experts
      • Data Studio Development & Consulting
    • Social Media & Local Marketing
      • Social Media Marketing
      • Local SEO
    • Web Development
      • Mobile Website Design
      • WordPress Development
  • Case Studies
    • SEO Case Studies
      • SEO Case Study: We Beat Lowes, Then We Beat Home Depot
      • SEO Case Study: Total Domination in Houston for Medical Provider
    • Analytics Case Studies
      • Case Study: Updated Design Yields 43% Increase in Conversion Rate
      • Case Study: PPC Optimization Yields Tripled Conversion Rate
    • Social Media Case Studies
      • Social Media Case Study: Hundreds of New Customers From Core Facebook Campaign
  • Portfolios
    • Display Ad Portfolio
    • Design Portfolio
    • Infographic Portfolio
    • SEO Testimonials
  • Contact
    • New Customers: Get to Know Us
    • Customer Service & Support
    • Referral Program
    • SEO Training Seminars
    • Job: Paid Search/PPC/Adwords Analyst
    • Job: Local Digital Marketing Specialist
    • Job: SEO/Marketing Junior Analyst
    • Privacy Policy & Terms of Use
  • Click to open the search input field Click to open the search input field Search
  • Menu Menu

How to Fix WordPress Robots.txt after Googlebot Cannot Access JS and CSS Warning

WordPress

We’ve been doing SEO for WordPress for a long time. A big part of that has always been controlling the amount, and quality, of indexed pages, since WordPress creates so many different flavors of content automatically. If you’ve read Michael David’s book on WordPress SEO, you’ve seen his ultimate robots.txt file
https://tastyplacement.com/book-excerpt-the-ultimate-wordpress-robots-txt-file which goes something like this:
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: /tag/
Disallow: */trackback
Disallow: */comments

Unfortunately, we’re in a post-Mobilegeddon world. Google is expecting free access to render every page in its entirety so it can infer the sort of experience a user would have on various mobile devices. A few weeks ago, a significant portion of the WordPress installations in the world received the Google Search Console warning:

Googlebot cannot access CSS and JS files

Some of you may be wondering why we can’t just remove all Robots.txt disallow rules and let Googlebot decide what it thinks is important, and stop being fussy about what’s allowed and disallowed. For security reasons, you don’t want to have deep indexing of your site publicly searchable. For instance, the following search term gives you a list of thousands of WordPress installations which have the highly hackable timthumb.php:

intitle:index timthumb.php

Just something to think about when you assume that Google has your site’s best interests at heart.

It’s possible that you can go through each resource, and allow the precise file paths line by line. But that’s going to be very time consuming.

The solution which has been going around (advocated by the likes of SEOroundtable and Peter Mahoney is to add an additional few lines which explicitely allow Google’s spiders access to the resources in question:

user-agent: googlebot
Allow: .js
Allow: .css
#THE ABOVE CODE IS WRONG!

Yes, this unblocks the javascript and CSS resources, you can see it working in the Search Console fetch and render tool. Unfortunately, this also allows Googlebot access to the entire site.

If you haven’t read the Google developers page on Robots.txt, I highly recommend doing so. It’s like 50 Shades of Grey for nerds. The section under “Order of Precedence for User-Agents” states “Only one group of group-member records is valid for a particular crawler . . . the most specific user-agent that still matches. All other groups of records are ignored by the crawler.” By creating a new group for Googlebot, you are effectively erasing all prior disallow commands.
Google search console allowed robots tester
You can try putting the allow directives within the main group-member, but that won’t work either, because of the order of precedence of group-member records. The longest (most specific) rule is going to win, so the following rules would leave the javascript resources blocked:
user-agent: googlebot
disallow: /wp-content/
allow: .js

google search console robots tester blocked

And wildcard conflicts are undefined. So it’s a tossup result for:
user-agent: googlebot
disallow: /wp-content/themes/
allow: /wp-content/themes/*.js

The long and the short of it is there is no simple cut-and-paste solution to this issue. We’re approaching it on a case by case basis, doing what’s necessary for each WordPress installation.

As far as keeping the indexes clean, we’re going to lean heavily on the robots metatags, as managed by our (still) favorite SEO plugin. Expect the role of robots.txt to be greatly reduced going forward.

August 12, 2015/by Matthew Bey
https://tastyplacement.com/wp-content/uploads/wp-tutorial2.jpg 384 848 Matthew Bey https://tastyplacement.com/wp-content/uploads/tastyplacementneedssvg.svg Matthew Bey2015-08-12 15:04:232019-11-01 13:17:48How to Fix WordPress Robots.txt after Googlebot Cannot Access JS and CSS Warning
0 replies

Leave a Reply

Want to join the discussion?
Feel free to contribute!

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Tutorials & Case Studies

  • Analytics
  • Case Studies
  • Infographics
  • Local Maps and Local Listings
  • Magento
  • Mobile SEO
  • Our Book: SEO for Wordpress
  • PPC
  • Programming & PHP
  • SEO
  • SEO Power Tools
  • SEO Resources
  • Social Media Marketing
  • Web Design
  • WordPress

Our Most Recent Tutorials & Case Studies

  • Tired of Expensive Website Uptime Monitoring Services? Build Your Own Uptime Monitor, 100% Free
  • Determining how and when Google Analytics 4 collects website event data
  • Infographic: Fonts & Colors That Drive the World’s Top Brands
  • Research Shows a 23% Divergence Between UA and GA4
  • How to Track Google Analytics Conversions on BuilderTrend’s iFrame Form

Search

Search Search

Archives & Tutorial Categories

  • Analytics
  • Case Studies
  • Infographics
  • Local Maps and Local Listings
  • Magento
  • Mobile SEO
  • Our Book: SEO for Wordpress
  • PPC
  • Programming & PHP
  • SEO
  • SEO Power Tools
  • SEO Resources
  • Social Media Marketing
  • Web Design
  • WordPress

Austin SEO Company, TastyPlacement

Click Here to Explore a Free Consultation

Our Most Popular Services

  • Austin SEO [Home]
  • WordPress SEO Service
  • PPC Management
  • Social Media Marketing
  • Analytics and Monitoring
  • Remarketing Experts
  • Conversion Rate Optimization

Let’s Talk: How to Get in Touch With Us

TastyPlacement Inc.
1214 W. 6th St. Ste 201
Austin, TX 78703
Tel: (512) 535-2492


Get Directions or Read Our Awesome Reviews on Google Maps
© Copyright - Austin SEO Company | TastyPlacement
  • Link to Facebook Link to Facebook Link to Facebook
  • Link to Instagram
  • Link to LinkedIn Link to LinkedIn Link to LinkedIn
  • Link to Pinterest
Link to: How to Make a Mobile Site Click to Call Link Link to: How to Make a Mobile Site Click to Call Link How to Make a Mobile Site Click to Call Link Link to: Getting Started With WordPress Link to: Getting Started With WordPress Getting Started With WordPress
Scroll to top Scroll to top Scroll to top