How to Unblock CSS & JS Files for Googlebot in WordPress

Unblock CSS & JS Files for Googlebot
How to Unblock CSS & JS Files for Googlebot in WordPress

If you operate a WordPress site, Google Search Console might have flagged the following issue: "Unblock CSS & JS files for Googlebot." Panic not — the error is common, and fortunately, the solution is simple. In this guide, you'll learn what the message means, why it's important, and how to fix it step by step.

What Significance Does the Error Have?

Google's web crawler is Googlebot. It crawls websites to learn about their content. It has access to every aspect of your site, including CSS and JavaScript files. Googlebot may not fully grasp your page if it cannot load these files. That indicates worse search results.

Why should it be a problem?

CSS determines the style of your website. Usually, managing interactive components is done in JavaScript. Should Googlebot fail to see them:

  • Google might see that your website seems to be broken.
  • Though your stuff may seem low-quality.
  • Your SEO might suffer.

Step 1

  • It changes mobile friendliness inspections.
  • Therefore, correcting this mistake becomes imperative.
  • First step: See Google Search Console.
  • Beginning with the Google Search Console. Click this alert for further information.
  • You can also use the URL Inspection Tool. Check if CSS and JS files are obstructed by entering your website URL.

Step 2: Locate blocked resources

Then, determine which files are banned. Visit:

Google Search Console, index, coverage, blocked resources.

Step 3: Verify your robots.txt file

  • To see it:
  • Googlebot has subsequently stopped accessing your CSS and JS files.
  • Fourth stage: modify the robots.txt file.
  • You must grant access to solve it.
Better versions of robots.txt follow here:

User-agent: *
Disallow: /wp-admin/
Disallow: /wp-includes/
Disallow: /wp-content/plugins/
Disallow: /wp-content/themes/

Step 4

  • This version permits access to vital folders but stops at the admin area.
  • Editing the file:
  • Use an SEO plugin such as Rank Math or Yoast SEO.
  • Save the file after editing.

Step 5: Examine the Repair

  • Go back to Google Search Console. Check the revised robots.txt file once more with the URL Inspection Tool.
  • Tell Google to recrawl your website by clicking Request Indexing if everything appears decent.
  • Sixth step: Wipe your cache.
  • Clear your cache if you utilize a caching plugin (like W3 Total Cache, WP Super Cache, or LiteSpeed Cache).
  • This makes certain that Google sees the most current version of your website.

Step 6: Let Google Recrawl

  1. Google does not immediately update. Grant some days for your website.
  2. You ought to soon have the Search Console warning vanish.
  3. Additional advice:
  4. Do not stop access to the /wpcontent/ and /wpincludes/ folders.
  5. Keep your theme and plugins current.
  6. Regularly check Google Search Console for any serious issues.
  7. Check on the health of your site with tools like Screaming Frog or Ahrefs Site Audit.

You can also read our post on WordPress Facebook Thumbnail Correction that often comes up in similar situations.

Final Thoughts

Fixing the WordPress issue "Googlebot cannot approach CSS and JS files" is smooth.

Letting CSS and JS files enables Google to better comprehend your site. Better visibility and SEO result from this.

Related Solutions