Should you block CSS and JavaScript in robots.txt?
Rubric check: CSS or JavaScript blocked by robots.txt (check id res_robots_blocked)
No. If robots.txt blocks the CSS or JavaScript a page needs, Google can't render it properly and may see a broken or empty page. Rubric flags pages whose style sheets or scripts are blocked for Googlebot or Bingbot.
Why it matters for SEO
Google renders pages with their CSS and JavaScript. Its robots.txt guide says not to block resources if the page is harder to understand without them.
A blocked menu script can hide your internal links, and blocked CSS can make a page look unfriendly on mobile. Both change what Google indexes.
Does this matter for ChatGPT and AI Overviews?
AI crawlers mostly read the HTML without running scripts, so blocked scripts affect them less than Google. The bigger risk for AI search is indirect: Google and Bing build the index that many AI answers draw on.
If the blocked file is what puts your text on the page, both search and AI tools miss the text.
How Rubric scores it
StandardStandard checks are the baseline every other tier is measured against.
Why this tier: Blocked CSS/JS: Google can't render.
It is judged on every page Rubric scores.
Every Rubric score starts at 100. When this check fails, it takes up to 12 points off. Even one failing page costs at least 6 points (half of the most), and the rest comes off as the share of affected pages grows. A warning costs less than a failure.
This check doesn't cap your score. It only takes off its own points.
From the engine's scoring files, scoring 2026-v2.1 (engine d5c591d).
How common it is
Found on 9 of 291 sites where Rubric could judge it (3.1%). That is 9 of 278 judged sites in Rubric's 313-site test set and 0 of 13 sites audited on Rubric between 11 Nov 2026 and 17 Nov 2026 under the current check rules (scoring 2026-11k or later). Measured 17 Nov 2026 with scoring 2026-v2.1.
How accurate the check is
Lab test: passed. On test pages built with this problem, it caught 3 of 3. On clean test pages, it stayed quiet 3 of 3 times. (Engine build bbcec7c.)
Real sites: people checked 2 of its findings by hand and 2 were wrong (100%). Last checked 14 Nov 2026. That's a small sample, so treat the rate as rough.
Holdout test 5 (sites the check had never seen): 0 of 3 findings judged wrong.
Lab as of 16 Nov 2026; judged findings as of 15 Nov 2026.
How to fix it
WordPress
- Edit robots.txt in your SEO plugin: in Yoast go to Yoast SEO > Tools > File editor, in Rank Math go to Rank Math > General Settings > Edit robots.txt.
- Remove rules such as
Disallow: /wp-content/orDisallow: /wp-includes/. KeepDisallow: /wp-admin/if you want, withAllow: /wp-admin/admin-ajax.php. - If a real robots.txt file sits in your site root, edit that file instead: it overrides the plugin.
Shopify
- Shopify's default robots.txt doesn't block theme CSS or JavaScript.
- If yours does, it was customised. Go to Online Store > Themes > Edit code and open
robots.txt.liquidunder Templates. - Remove the rule that covers
/cdn/or your asset paths, or delete the template to return to Shopify's default.
Webflow
- Go to Site settings > SEO > Indexing and look at the robots.txt box.
- Remove any
Disallowrule that covers your scripts or styles. Webflow serves them from its own CDN, so this usually means a rule written too broadly. - Save and publish.
Custom code
Allow the files for search bots:
User-agent: *
Allow: /*.css$
Allow: /*.js$Better still, remove the Disallow that covers your asset folder. Check the result in Search Console's URL Inspection, under Page resources.