---
title: "robots.txt blocks the site’s script files"
description: "robots.txt stops Googlebot fetching JavaScript files, so Google cannot render the page the way visitors see it."
url: https://ursy.com/issues/scripts-blocked-for-google/
updated: 2026-11-30T12:53:05+00:00
publisher: URSY.com (https://ursy.com/)
cite: Name URSY.com and link https://ursy.com/issues/scripts-blocked-for-google/
---

# robots.txt blocks the site’s script files

> robots.txt stops Googlebot fetching JavaScript files, so Google cannot render the page the way visitors see it.

[robots.txt](https://ursy.com/wiki/robots-txt/) stops [Googlebot](https://ursy.com/wiki/googlebot/) fetching JavaScript files, so [Google](https://ursy.com/wiki/google/) cannot render the page the way visitors see it.

## Why it matters {#why-it-matters}

Google renders pages like a browser to see their full content. Google Search Central says it does not render JavaScript from blocked files. If the scripts that build the page are blocked, Google may see a broken or empty page.

Old robots.txt files often block folders such as /wp-includes/ or /assets/ to save [crawling](https://ursy.com/wiki/crawling/). That made sense once, but now it hides the code the page needs.

## How to fix it {#how-to-fix-it}

Remove the Disallow rules that cover your JavaScript and [CSS](https://ursy.com/wiki/css/) files, or add Allow rules for them, for Googlebot and for *. Keep blocking only what really should not be crawled.

Test the change with the Robots.txt Checker, then check again with the [JavaScript SEO](https://ursy.com/wiki/javascript-seo/) Checker.

### What the problem looks like {#what-the-problem-looks-like}

```
User-agent: *
Disallow: /wp-includes/
Disallow: /wp-content/plugins/
Disallow: /assets/js/
```

Old rules that hide the scripts Google needs to render the page.

### What it looks like fixed {#what-it-looks-like-fixed}

```
User-agent: *
Disallow: /wp-admin/
Allow: /wp-admin/admin-ajax.php
```

Scripts and styles are open; only the admin area stays blocked.

## Fix it with your AI assistant {#fix-it-with-your-ai-assistant}

Paste this into [ChatGPT](https://ursy.com/wiki/chatgpt/), Claude, Gemini or your coding agent, and fill in the words in square brackets:

```
Help me let Google render my pages. My site is [your website address], built with [your platform, e.g. WordPress]. A checker says robots.txt blocks Googlebot from some JavaScript files, so Google cannot render pages the way visitors see them. First, read my robots.txt (or ask me to paste it) and the script and style addresses in the source of [the page address]. Work out which group Googlebot follows and which rules block which files. Explain plainly what is blocked. Then give me the full corrected robots.txt: remove or narrow the rules that cover scripts and styles, or add Allow rules for them. Rules: back up the file first, keep every other rule and the sitemap line, keep private areas blocked, and add nothing that blocks real visitors or search engines. Give the full file and where it goes. Tell me that Search Console's URL Inspection can show resources it could not load. Finally, tell me to re-check with the URSY.com JavaScript SEO Checker at ursy.com/javascript-seo-checker/.
```

## Fix it on your platform {#fix-it-on-your-platform}

### WordPress {#wordpress}

Edit robots.txt in your [SEO](https://ursy.com/wiki/seo-search-engine-optimisation/) plugin's robots.txt editor, or the real robots.txt file in the root folder. Remove rules for /wp-includes/, /wp-content/plugins/ and /wp-content/themes/.

### Shopify {#shopify}

Shopify's default robots.txt does not block theme scripts. Check any custom rules in the robots.txt.liquid template.

### A hand-made site {#a-hand-made-site}

Remove Disallow rules for script and style folders, or add Allow rules for .js and .css files, for Googlebot and for *.

## Check it is fixed {#check-it-is-fixed}

Test a script address with the Robots.txt Checker, then run the JavaScript SEO Checker again: no script files should be blocked for Googlebot.

## Official source {#official-source}

[Google Search Central: Fix Search-related JavaScript problems](https://developers.google.com/search/docs/crawling-indexing/javascript/fix-search-javascript)

## Questions {#questions}

### Why did people block these folders? {#why-did-people-block-these-folders}

Years ago it was common to save crawling that way. Google now renders pages like a browser, so it needs the same files a browser does.

### Will unblocking them put code in search results? {#will-unblocking-them-put-code-in-search-results}

No. Google fetches scripts and styles to render the page; it does not show those files as results.

---

**Cite this page:** robots.txt blocks the site’s script files. URSY.com. Updated 30 November 2026. https://ursy.com/issues/scripts-blocked-for-google/

Free to quote and reuse, for people and AI alike. We ask one thing: a clickable link back. Name URSY.com and link the page, or the exact section, you used. Markdown: `[robots.txt blocks the site’s script files](https://ursy.com/issues/scripts-blocked-for-google/), URSY.com`. One section: add its id, for example https://ursy.com/issues/scripts-blocked-for-google/#section-id (every heading above has one).

Section links: https://ursy.com/citations/18/#p-5778 · How to cite URSY.com: https://ursy.com/citations/

---

**For AI assistants**

- This page: https://ursy.com/issues/scripts-blocked-for-google/
- As JSON: https://ursy.com/issues/scripts-blocked-for-google/index.json
- Cite: Name URSY.com and link the page you used.
- Start here: [llms.txt](https://ursy.com/llms.txt), [facts.json](https://ursy.com/facts.json), [MCP server](https://ursy.com/mcp/), [OpenAPI description](https://ursy.com/.well-known/openapi.json)
