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
- In Search Console, open Indexing, then Pages, and click "Blocked by robots.txt". Copy the full address of one affected URL.
- Open Robots.txt Tester.
- In "Website URL" type the domain exactly as it appears in the copied URL, with
www.or without, and press "Fetch robots.txt". - Under "3. Test URLs", choose Googlebot as the Crawler and paste the copied URL. The tester keeps only the path and query string.
- 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
- Edit the text in "2. robots.txt content" on the tester page. Do not touch the live file yet.
- 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.
- Check that each shows the result you want.
- 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.
- Upload it to the site's root folder.
- Press "Fetch robots.txt" again and test the affected URL. It should now show Allowed.
Step 4: ask Google to check again
- In Search Console, go back to the "Blocked by robots.txt" issue in the Pages report and press "Validate fix".
- 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.
- 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:
- Remove the Disallow rule so Google can crawl the page.
- Add a
noindexrobots meta tag to the page. You can check it afterwards with the Meta Tag Checker. - 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.



