Check A2.7 · Render resources not blocked by robots.txt

Let crawlers fetch the scripts and stylesheets your pages need

Why robots.txt rules that block JavaScript and CSS stop Googlebot, Applebot and Bingbot from rendering product pages, and how to allow your theme and plugin assets.

By · Updated · Markdown

Check 7 of 14 in Bot access control · 15 of 87 overall
Priority
Nice to have Weight 1. Helps agents, rarely decisive on its own.
Readiness level
Not a level gate. It counts toward its section score.
The question
May the crawlers that render pages fetch the scripts and stylesheets the page needs?
On this page

In short

Search crawlers, the programs that build search and AI indexes, render pages like a browser, so they need the page's own JavaScript and CSS files. If robots.txt (the file that tells crawlers what they may fetch) disallows those files, Google cannot run the blocked scripts and may miss content they produce. This check evaluates the same-origin scripts and stylesheets of sampled product pages against robots.txt for Googlebot and Bingbot.

What this check looks at

A product page usually loads several scripts and stylesheets from its own domain: theme files, plugin files, a bundle built by your framework. robots.txt can disallow those paths just like any page. Older WordPress guides, for example, recommended Disallow: /wp-includes/, which also covers the core JavaScript files many themes load.

The scanner collects the script and stylesheet URLs of the sampled product pages, or of the home page when it sampled no products. It evaluates up to 50 of them. Three kinds of asset are left out:

  • Cross-origin assets. Files on a CDN or another domain fall under that host's robots.txt, not yours.
  • Transactional assets. Files under cart, basket, bag, checkout, account, order or admin paths, including shoppingcart, warenkorb, kasse and panier. Platforms disallow those areas on purpose. Shopify, for example, ships a checkout preload script on product pages, and a product page renders without it. These are listed in the evidence but not judged.
  • Unparsable URLs. A broken src cannot be fetched by anyone.

Each remaining path is then checked against robots.txt under RFC 9309, once for Googlebot and once for Bingbot.

Why it matters for AI agents

Google documents that it does not render JavaScript from blocked files or blocked pages. If a script fills in the price, the variant picker or the description, Google sees the page without it. Apple documents that Applebot follows Googlebot rules when it has none of its own, and that it may not render a page whose resources are blocked. Bing's guidelines say content it cannot render may be left out of grounding, the step where Copilot looks up pages to support an answer.

The indexes these crawlers build are what AI answers draw from. A product page that renders as an empty shell to the crawler gives those answers less to work with.

The best protection is to put the product content in the HTML itself, which the server-rendered product content check covers. This check makes sure rendering works for whatever still depends on scripts.

How the scanner decides

  • Not applicable: the sampled pages load no same-origin scripts or stylesheets.
  • Pass: every evaluated asset may be fetched by both Googlebot and Bingbot, or there are no robots.txt rules.
  • Warn: at least one asset is disallowed for Bingbot, but none for Googlebot.
  • Fail: at least one asset is disallowed for Googlebot.

The evidence shows how many assets were checked, up to ten blocked paths per crawler with the total counts, and the transactional assets that were set aside.

It is not a gate for any level, but a fail here can undermine content that other checks assume crawlers can see.

How to fix it

Remove the robots.txt rules that cover asset paths, or add more specific Allow rules for the assets. Under RFC 9309 the longest matching rule wins, so Allow: /wp-includes/js/ beats Disallow: /wp-includes/.

WordPress and WooCommerce

  • Look for Disallow: /wp-includes/, Disallow: /wp-content/plugins/ or Disallow: /wp-content/themes/ in robots.txt. These come from old advice and block the files your theme loads.
  • Delete those lines, or add Allow rules for the JavaScript and CSS under them. Keep Disallow: /wp-admin/ with its usual Allow: /wp-admin/admin-ajax.php.
  • Edit through your SEO plugin's robots.txt editor, or the physical robots.txt file if one exists.

Shopify

  • Shopify's default robots.txt does not block theme assets.
  • If you customised robots.txt.liquid, check that no added rule matches /cdn/ or asset paths on your store domain.
  • Scripts under checkout paths are ignored by this check, so the default checkout rules are fine.

Any other stack

  • List the script and stylesheet paths your product template loads, such as /assets/, /static/, /_next/ or /build/.
  • Remove any Disallow rule that matches them, including wildcard rules such as Disallow: /*.js$.
  • If a directory must stay disallowed, add Allow rules for its JavaScript and CSS.

Verify it yourself

List the same-origin assets of a product page:

curl -s https://example.com/products/example | grep -oE "(src|href)=\"/[^\"]+\.(js|css)[^\"]*\"" | sort -u
curl -s https://example.com/robots.txt

Compare each path with the Disallow lines in the groups that apply to Googlebot and Bingbot. Google Search Console's URL Inspection tool also lists page resources it could not load, with the reason.

Common mistakes

  • Following old WordPress advice. Blocking /wp-includes/ and /wp-content/plugins/ was common in older guides. It stops crawlers from rendering pages that load those files.
  • Blocking every script with a wildcard. Disallow: /*.js matches the scripts your product page needs.
  • Forgetting Googlebot's own group. If robots.txt has a User-agent: Googlebot group, Googlebot ignores the wildcard group. An Allow for assets in the wildcard group does not help it.
  • Worrying about cross-origin assets. Files on a separate CDN host follow that host's robots.txt. This check does not judge them.

FAQ

Should I block wp-includes in robots.txt?

No. /wp-includes/ holds JavaScript that many themes load on every page. Blocking it stops crawlers from rendering those pages. Keep /wp-admin/ disallowed instead.

Does blocking CSS really matter if my content is in the HTML?

Less than blocking scripts, but the check still fails on it. Crawlers render pages the way a browser does, and a page without its stylesheets is not the page your visitors see. Allowing your own CSS costs nothing.

Why are checkout scripts ignored?

Platforms disallow checkout, cart and account paths on purpose, and a product page renders without those scripts. Judging them would flag a sensible default as a problem.

Applebot has no group in my robots.txt. Which rules does it use?

Apple documents that Applebot follows the Googlebot rules when robots.txt has no Applebot group. That is why this check tests Googlebot and treats a Googlebot block as the more serious one.

The fix in one step

Allow crawlers to fetch the site's own JavaScript and CSS: remove robots.txt Disallow rules that cover script and stylesheet paths, or add Allow rules for them.

User-agent: *
Allow: /assets/*.js
Allow: /assets/*.css
Disallow: /admin/

By platform

WordPress and WooCommerce
The usual culprits are `Disallow: /wp-includes/` and `/wp-content/plugins/`. Allow `/wp-includes/js/` and the plugin scripts and stylesheets (`Allow: /wp-content/plugins/*.js`, `Allow: /wp-content/plugins/*.css`) and keep `/wp-admin/` disallowed.
Prompt for a coding agent

This site's robots.txt disallows some of the same-origin scripts or stylesheets that its product pages load, for Googlebot or for Bingbot. Open robots.txt and find the Disallow rules that match the site's script or stylesheet URLs (typical culprits: `Disallow: /assets/`, `/static/`, `/*.js$`, `/*.css$`). Either delete those rules or add explicit Allow rules for the asset paths (for example `Allow: /assets/*.js`, `Allow: /assets/*.css`). Under RFC 9309 the longest matching rule wins, whatever the order. Googlebot, Bingbot and Applebot need these files to render the page. Verify by evaluating one script URL and one stylesheet URL from a product page against the new robots.txt for Googlebot.

Sources and specifications

See how your store does

One scan runs every check in this knowledge base against your site and ends with a prioritised fix list.

Scan a store