Skip to the content

Contact usFree tools · No signup · Files stay on your device

SEO & Marketing

"Blocked by robots.txt" in Search Console: how to fix it

"Blocked by robots.txt" in Search Console: how to fix it

You open the Page indexing report in Google Search Console and find pages listed under "Blocked by robots.txt". Some of them are pages you wanted to hide. Others are articles or products you wanted in Google, and Google says it was not allowed to visit them. This post shows how to find the exact line in robots.txt that causes it, change it without breaking anything else, and ask Google to check again. The tool you need is the free Robots.txt Tester.

First, decide whether it needs fixing

Two similar statuses appear in Search Console:

  • Blocked by robots.txt: Google found the URL but did not crawl it, so it was not indexed.
  • Indexed, though blocked by robots.txt: Google indexed the URL anyway, usually because other pages link to it, but could not read it. The search listing may have no description.

Look at the example URLs. If they are cart pages, checkout, login, /wp-admin/ or search result pages, the blocking is doing its job and you can leave it. If they are pages you want people to find, keep reading.

Step 1: find the rule that blocks the page

  1. In Search Console, open Indexing, then Pages, and click "Blocked by robots.txt". Copy the full address of one affected URL.
  2. Open Robots.txt Tester.
  3. In "Website URL" type the domain exactly as it appears in the copied URL, with www. or without, and press "Fetch robots.txt".
  4. Under "3. Test URLs", choose Googlebot as the Crawler and paste the copied URL. The tester keeps only the path and query string.
  5. Read the result. You will see Blocked, the rule, and its line number, for example Disallow: /shop (line 2).

The domain matters because every host has its own robots.txt. https://example.com and https://www.example.com can serve different files, and so can http://. Always test the host from the Search Console URL.

Step 2: understand why the rule matches

These are the usual causes, in the order worth checking.

A leftover staging rule

If your developer built the site on a test copy, the file may still contain:

User-agent: *
Disallow: /

The tester shows every page Blocked by Disallow: / on line 2. Delete the Disallow: / line or replace it with an empty Disallow:, which blocks nothing.

A rule that is too short

Rules match from the start of the address. Suppose a shop owner in Dhaka wanted to block only the page /shop-admin:

User-agent: *
Disallow: /shop
Disallow: /cart/

Disallow: /shop also blocks /shop/panjabi, /shop-guide/eid-sale and everything else beginning with those letters. The tester shows /shop-guide/eid-sale as Blocked by "Disallow: /shop (line 2)". Change it to Disallow: /shop-admin and test again.

A wildcard that catches too much

A rule such as Disallow: /*? blocks every address that contains a question mark, including harmless pages with tracking parameters or pagination. Narrow it to the parameter you really mean, for example Disallow: /*?sessionid=.

A folder you blocked, with one page you still need

Add an Allow line for the page. The longer rule wins, so this works:

User-agent: *
Disallow: /downloads/
Allow: /downloads/ssc-routine.pdf

The CMS or host wrote the rule

WordPress has a setting called "Discourage search engines from indexing this site" under Settings, then Reading. Ticked by mistake, it can block the whole site. Some SEO plugins, security plugins and hosting panels also add their own rules or serve their own robots.txt. If the file you fetch is not the one you wrote, look there.

A temporary server error

If robots.txt answered with a 5xx error or 429 when Google tried, Google treats the whole site as blocked until it can read the file again. The tester shows the HTTP status after a fetch, and tells you if it was a server error. Fix the server first.

Step 3: change the file and test before you upload

  1. Edit the text in "2. robots.txt content" on the tester page. Do not touch the live file yet.
  2. Add a few important addresses to the "URLs or paths to test" list: the affected page, your home page and a page that should stay blocked.
  3. Check that each shows the result you want.
  4. Copy the corrected text into your real robots.txt. If you need to start from a clean file, the Robots.txt Generator can write one, and its guide explains each option.
  5. Upload it to the site's root folder.
  6. Press "Fetch robots.txt" again and test the affected URL. It should now show Allowed.

Step 4: ask Google to check again

  1. In Search Console, go back to the "Blocked by robots.txt" issue in the Pages report and press "Validate fix".
  2. Google fetches robots.txt again and recrawls the affected pages over the next days. It may keep using the old copy of robots.txt for a while, so do not be alarmed if nothing changes at once.
  3. For a single important page, open "URL Inspection", paste the address and press "Request indexing" after the live test shows that crawling is allowed.

Allowing a page to be crawled does not guarantee that it will be indexed. Google still decides whether the page is useful enough.

If you want the page gone instead

Sometimes a page appears as "Indexed, though blocked by robots.txt" and you wish it did not. Blocking with robots.txt is not the way to remove a page. Google has to be able to read the page to see a noindex tag, so:

  1. Remove the Disallow rule so Google can crawl the page.
  2. Add a noindex robots meta tag to the page. You can check it afterwards with the Meta Tag Checker.
  3. Wait for Google to recrawl and drop the page. Then, if you want, block the folder again.

If the page contains private information, remove or password-protect it. Robots.txt hides nothing from people.

Mistakes to avoid

  • Testing the wrong host. Use the exact host from Search Console.
  • Fixing the live file without testing the edit first.
  • Blocking CSS, JavaScript or image folders. Google needs them to display your pages properly.
  • Listing blocked URLs in your sitemap. Either unblock them or take them out of the sitemap.
  • Using robots.txt to keep a page out of search results.

Quick checklist

  • Copy the exact URL and host from Search Console.
  • Fetch the live robots.txt and test with Googlebot.
  • Read the rule and line, then narrow or remove it.
  • Test the edit, upload, fetch again.
  • Press "Validate fix" and wait.

Frequently asked questions

Is Blocked by robots.txt always a problem?
No. If the blocked URLs are pages you meant to hide from crawlers, such as a cart, checkout or internal search results, the status is correct and you can leave it. Fix it only for pages you want people to find in Google.
What is the difference between Blocked by robots.txt and Indexed, though blocked by robots.txt?
The first means Google did not index the URL. The second means Google indexed it anyway, usually because other pages link to it, but could not read the content, so the listing may show little or no description.
Will fixing robots.txt get my page indexed straight away?
No. After the file is fixed, Google has to fetch it again and then recrawl the page. That can take days, and Google decides whether the page is worth indexing.
How do I remove a page from Google if robots.txt blocks it?
Let Google crawl it again and add a noindex tag, or remove the page properly. While robots.txt blocks the page, Google cannot read a noindex tag on it.
Why does the tester show Allowed but Search Console says blocked?
Usually the host differs (www or non-www, http or https), Google is using an older cached copy of robots.txt, or another file is being served from that host. Test the exact URL from Search Console against that host's live robots.txt.
Found this useful? Share it

Tools in this guide

Main tool

Robots.txt Tester

Check whether a crawler is allowed to visit a URL.

Open tool

Robots.txt Generator

Build a robots.txt file from presets and simple choices: block AI crawlers, keep admin and cart pages out of search, add your sitemap,.

Open tool

Meta Tag Checker

Enter a URL to see every SEO-relevant tag on the page, how it will look in Google and on social media, and exactly what to fix.

Open tool

Back to all guides & blog