On this page
What this issue is
robots.txt is a plain text file at the root of your site that tells crawlers which URLs they may fetch. Pages are not just HTML. They also load stylesheets (CSS), scripts (JS), fonts and sometimes JSON data from other paths.
Googlebot renders pages much like a browser does. If a rule such as Disallow: /assets/ or Disallow: /wp-includes/ covers files the page needs, Google can't load them. The page it sees may look unstyled, miss content that scripts add, or hide menus and links.
This often happens by accident. Old SEO advice said to hide script and theme folders, and some plugins or developers still add those rules. Files served from a CDN or another domain follow the robots.txt of that domain, which is easy to forget.
User-agent: *
Disallow: /wp-includes/
Disallow: /wp-content/themes/
Disallow: /assets/js/
Disallow: /static/Why it costs you leads or sales
If Google can't render a page properly, it may misread what the page is about. Text added by JavaScript, product details, reviews or internal links can be missed. A layout that looks broken to Google may also be judged as not mobile friendly.
The result is weaker rankings or pages that are indexed with thin content. That means fewer visitors finding your landing pages and product pages from search, and fewer leads and sales from them. The impact is usually medium: your site still works for people, but search visibility quietly suffers.
- Googlebot fetches HTMLPage HTML loads fine
- CSS/JS requestedrobots.txt says Disallow
- Page renderedUnstyled or missing content
- Ranking and clicksWeaker understanding of the page
Googlebot fetches the HTML, but the blocked files stop it seeing the real page.
How to check if your site has it
Open your robots.txt
Visit https://yourdomain.com/robots.txt and look for Disallow lines covering folders like /wp-includes/, /wp-content/, /assets/, /static/, /js/, /css/ or file patterns such as *.js and *.css.
Inspect a key URL in Google Search Console
Paste a landing page into the URL Inspection tool, click Test Live URL, then View Tested Page and open the Screenshot and More Info tabs. Look at the list of page resources and any marked as blocked by robots.txt.
Compare the screenshot to your real page
If the rendered screenshot looks unstyled, has missing sections or hidden menus, a blocked file is the likely cause.
Check third-party hosts
Open your browser dev tools, go to the Network tab and note which domains serve your CSS and JS (a CDN, for example). Visit /robots.txt on each of those hosts too.
Test specific files
In Search Console, open Settings, then robots.txt report, to confirm Google's fetched version of the file. Use the URL Inspection tool on a script URL to see if it's blocked.
How to fix it
The fix is the same everywhere: stop disallowing files that pages need to render. Remove the rule, or narrow it so CSS, JS and fonts stay crawlable. Where the file lives and how you edit it depends on your platform.
Find where robots.txt comes from
It may be a physical file in the site root, a virtual one WordPress generates, or one managed by an SEO plugin (for example in Yoast SEO under Tools, File editor, or Rank Math under General Settings, Edit robots.txt).
Remove the blocking rules
Delete lines such as Disallow: /wp-includes/ or Disallow: /wp-content/themes/. Keep Disallow: /wp-admin/ with Allow: /wp-admin/admin-ajax.php if you use it.
Check for security or cache plugins
Some plugins write their own rules. If the line returns after you save, look in those plugins' settings.
Check whether you customised it
Shopify generates robots.txt from the theme template robots.txt.liquid. Go to Online Store, Themes, Edit code and look for that file under Templates.
Remove custom Disallow rules for assets
Delete any added rules that cover theme asset or CDN script paths. If you have no custom file, the default does not block them, so look at apps that inject scripts from other hosts.
Open the robots.txt editor
Go to Site settings, SEO, then the robots.txt field.
Remove rules covering assets
Delete Disallow lines for asset folders and publish the site again so the change goes live.
Open the file editor
Go to Marketing & SEO, SEO Tools, then Robots.txt Editor.
Remove custom blocks
Delete any custom Disallow lines that cover script or style paths, then save.
Know the limits
Squarespace generates robots.txt automatically and you can't edit it directly. Its default does not block CSS or JS.
Look elsewhere
If resources are blocked, they are likely served from another host you control (such as a CDN or script host). Fix the robots.txt on that host.
Edit the file at the web root
Open robots.txt in your project or server and remove Disallow lines covering CSS, JS, fonts or image folders.
Or add specific Allow rules
If you must block a folder, allow the asset types inside it. For Google, the more specific (longer) matching rule wins.
Deploy and clear caches
Publish the file and purge your CDN or server cache so Google fetches the new version.
User-agent: *
Disallow: /private-app/
Allow: /private-app/*.css
Allow: /private-app/*.jsBefore
- Disallow: /wp-includes/ and /assets/js/
- Google screenshot shows an unstyled page
- URL Inspection lists blocked resources
After
- Asset rules removed or narrowed with Allow
- Google screenshot matches the real page
- No resources blocked by robots.txt
How to confirm it's fixed
- Open /robots.txt in a browser and confirm the Disallow lines are gone
- In Search Console, check Settings, robots.txt report shows the new version fetched
- Run URL Inspection, Test Live URL on a key page and confirm no resources are blocked by robots.txt
- Compare the rendered screenshot with the live page
- Repeat the check on a page template of each type: home, landing, product, blog
- Request indexing for your most important pages
How to prevent it happening again
- Keep robots.txt in version control or note every edit and who made it
- Never copy a robots.txt from another site or an old guide without reading each line
- Block pages you don't want crawled, not the folders that hold code and styles
- Re-check robots.txt after theme changes, migrations, CDN changes and plugin installs
- Check the robots.txt of any separate host that serves your assets
- Review the URL Inspection rendered screenshot after major releases
How FunnelGuard handles this
FunnelGuard does not check this yet. Spotting CSS or JS blocked by robots.txt is a possible future check, but today it isn't part of the product.
What FunnelGuard does do is run your real customer journeys on a schedule, such as lead forms, checkouts and booking buttons, and check each step and the tracking hits. If a broken page stops a journey working for the robot visitor, you get an alert with a screenshot. That covers what real visitors experience, not what Googlebot can fetch.
To watch for this issue yourself, use the Search Console robots.txt report and URL Inspection tool after changes, and review your robots.txt whenever a theme, plugin or CDN changes. A free read-only website audit from FunnelGuard is also available, and the Free plan covers 1 site and 2 journeys with daily checks and no card.
Frequently asked questions
Questions people ask
Why does Google say my page resources are blocked by robots.txt?
A Disallow rule in robots.txt matches the URL of a CSS, JS or font file your page loads. Google obeys that rule and doesn't fetch the file. Find the matching line in your robots.txt, or in the robots.txt of the host serving the file, and remove or narrow it.
Should I block CSS and JavaScript in robots.txt?
No, not if pages need those files to display. Google renders pages like a browser, and blocked files can leave it with a broken or incomplete view of your content. Block pages you don't want crawled instead of asset folders.
How do I allow Googlebot to crawl CSS and JS files?
Remove the Disallow lines that cover them. If you need to keep a folder blocked, add Allow rules such as Allow: /folder/*.css and Allow: /folder/*.js. For Google, the longer, more specific matching rule takes precedence.
How do I test whether Googlebot can render my page?
Use the URL Inspection tool in Google Search Console, click Test Live URL, then View Tested Page. Check the screenshot and the page resources list for anything blocked by robots.txt.
Does blocking CSS and JS hurt SEO rankings?
It can. If Google can't render a page properly, it may miss content, links or mobile layout, which can weaken how the page is understood and ranked. The effect varies by site and how much the page relies on those files.
Why is my robots.txt blocking wp-includes?
Older WordPress SEO advice and some default or copied robots.txt files include Disallow: /wp-includes/. Delete that line, and check SEO and security plugins that might add it back.
Do third-party scripts need to be allowed in my robots.txt?
Files hosted on another domain follow that domain's robots.txt, not yours. You can't change theirs, but widely used CDNs and script hosts normally allow crawling. If a file from your own CDN is blocked, edit the robots.txt on that host.
Can FunnelGuard tell me if robots.txt blocks my CSS or JS?
Not yet. This is a possible future check. FunnelGuard currently monitors your funnel journeys, tracking hits and lead delivery, so use Google Search Console to check robots.txt blocking.
Related issues
- SEO-001robots.txt Disallow: / left over from staging blocks the whole siteFix guide
- SEO-002robots.txt blocks a money page or landing page directoryFix guide
- SEO-006robots.txt syntax errors or unsupported directives (noindex in robots.txt)Fix guide
- SEO-007robots.txt blocks images or product feeds needed for Shopping and ImagesFix guide
- SEO-008robots.txt rule conflicts (Allow vs Disallow precedence) block intended pagesFix guide
- SEO-021Links only in JavaScript onclick handlers, not crawlable <a href>Fix guide