How to fix robots.txt blocking Google from crawling your site
If your robots.txt file contains Disallow: / under User-agent: *, it tells Google to stay away from every page. Remove or change that line, save the file, and ask Google to re-read it in Search Console.
Your site can be live, fast and full of good pages, and still be invisible in Google because of a two-line text file. This page explains what that file looks like when it blocks everything, how to check yours in a few minutes, and how to fix it on common platforms.
What the problem is and what you see
A file called robots.txt sits at the root of your site (for example https://yourdomain.com/robots.txt). It gives instructions to crawlers such as Googlebot. The blocking version usually looks like this:
User-agent: *
Disallow: /
User-agent: * means every crawler. Disallow: / means every path on the site, starting from the home page. Together they say: do not crawl anything.
What people usually notice:
- New pages never show up in Google, or traffic drops sharply after a redesign or move.
- Searching for your business name shows your site with no description, or with the text "No information is available for this page".
- Google Search Console reports "Blocked by robots.txt" in the Page indexing report, or the URL Inspection tool says crawling is not allowed.
Why it matters
Search is the obvious loss: Google cannot read your pages, so it cannot judge them or rank them well. Enquiries, bookings and orders that would have come from search quietly stop.
There is also a trust and sales side. A business that cannot be found by name looks closed, and ads or social posts that send people to a site Google cannot read lose the benefit of search visibility around them.
One point that surprises people: robots.txt controls crawling, not indexing. If other sites link to a blocked page, Google may still list the bare URL without a description. Blocking is not a reliable way to hide pages, and it is not a security measure. Anyone can open your robots.txt and read it.
How to check if your site has it
All of these are free.
- Open
yourdomain.com/robots.txtin a browser. Look forDisallow: /on its own line, especially underUser-agent: *orUser-agent: Googlebot.Disallow:with nothing after it blocks nothing. - In Google Search Console, open Settings, then the robots.txt report. It shows the file Google last fetched, when, and any errors.
- Paste your home page address into the URL Inspection tool. Check the "Crawl allowed?" line. If it says No, a robots.txt rule is the cause.
- In the Page indexing report, look for the reason "Blocked by robots.txt" and open it to see the affected URLs.
Also test www and non-www, and http and https. Each host can serve its own robots.txt, and a forgotten one is a common culprit. If the file does not exist at all (a 404), Google treats that as no restrictions, which is fine. If it returns a server error (5xx), Google may pause crawling the site until it can read the file, so that needs fixing too.
How to fix it in general
Most of the time this comes from a staging or development setting that was copied to the live site, or from a "discourage search engines" switch left on after launch.
- Find where the file comes from. It may be a real file in the site's root folder, a setting in your platform, or a rule at your host or CDN.
- Remove the
Disallow: /line. A safe minimal file that allows everything is:
User-agent: *
Disallow:
Sitemap: https://yourdomain.com/sitemap.xml
- If you want to keep some areas private from crawlers (a cart, an admin area, internal search), block only those paths, such as
Disallow: /cart/, rather than the whole site. - Save, then reload
yourdomain.com/robots.txtin a private window to confirm the change is live. Caches at your host or CDN can delay it.
Common platforms
Exact menu names change between versions and themes, so treat these as where to look.
| Platform | Where it usually lives |
|---|---|
| WordPress | Settings, Reading, "Discourage search engines from indexing this site" (untick it). SEO plugins and a physical robots.txt file can also set rules. See the WordPress guide. |
| Shopify | Edited through a robots.txt.liquid template in the theme code. Delete a custom template to return to the default. See the Shopify guide. |
| Webflow | Site settings, SEO, Indexing, where you can edit the robots.txt content. Also check the setting for the Webflow subdomain. |
| Next.js | A public/robots.txt file, or app/robots.ts in newer projects. Check environment checks that switch to Disallow: / outside production. |
| Nginx | A location /robots.txt block or a file in the web root. Look for a rule that serves a blocking response. |
| Cloudflare | Check the managed robots.txt options under bot or AI crawler settings, and any Worker or rule that rewrites the file. |
| Magento | Content, Design, Configuration, then the Search Engine Robots section for the custom instructions. |
If your site is managed by an agency or developer, send them the exact line you found and the address of the file. That is usually enough for a quick fix.
How to confirm the fix worked
- Reload
yourdomain.com/robots.txtand check the blocking line is gone. - In Search Console, open the robots.txt report and use the option to request a recrawl of the file. Google normally caches robots.txt for up to about a day, so this speeds things up.
- Run URL Inspection on your home page and a few important pages. "Crawl allowed?" should now say Yes.
- Use "Request indexing" for your most important pages, and make sure your sitemap is submitted.
- Over the following days and weeks, watch the Page indexing report. Blocked URLs should move toward indexed. Recovery is not instant, and the speed depends on the site.
If pages stay out of Google after crawling is allowed, the cause may be something else, such as an accidental noindex tag. Both problems produce the same symptom, missing pages, but they need different fixes.
How to stop it coming back
- Check robots.txt as the last step of every launch, redesign, migration or host change.
- Keep staging and live settings separate, and never copy a staging robots.txt or "hide from search" setting across.
- Keep a copy of your correct robots.txt somewhere safe, so you can restore it quickly.
- Set up Search Console and look at the robots.txt and Page indexing reports after any big change.
- Limit who can edit the file and the settings that control it.
This is also one of the first things checked in week 1 of SiteMonday, the SEO review, which looks at whether search engines can reach your pages. It finds and explains the problem, and the fix itself stays with you or your developer.
Step by step for your platform
- Robots.txt blocking entire site on WordPress
- Robots.txt blocking entire site on Shopify
- Robots.txt blocking entire site on Webflow
- Robots.txt blocking entire site on Next.js
- Robots.txt blocking entire site on Nginx
- Robots.txt blocking entire site on Cloudflare
- Robots.txt blocking entire site on Magento
Questions
Does Disallow: / remove my site from Google?
Not directly. It stops Google from crawling, so pages usually drop out over time or show without a description, but blocked URLs can still appear if other sites link to them.
How long until Google sees my corrected robots.txt?
Google usually caches the file for up to about 24 hours. You can request a recrawl of it in the Search Console robots.txt report to speed this up.
Is robots.txt the same as a noindex tag?
No. robots.txt controls whether Google may crawl a page, while a noindex tag tells Google not to show a page in results. A noindex tag only works if Google is allowed to crawl the page and see it.
Why did my robots.txt change by itself?
Usually a plugin, a platform setting, a deployment that copied the staging file, or a CDN rule rewrote it. Check recent site changes and who has access to the settings.
Should I block anything in robots.txt at all?
Often yes, for low value areas such as carts, admin pages or internal search results. Just block specific paths, never `/` alone, and do not use it to hide private content.
My robots.txt looks fine but Search Console says blocked. Why?
Google may still hold an older cached copy, or a different host (such as `www` versus non-`www`) may serve a different file. Check each version and request a recrawl.