Fix robots.txt blocking search engines
By Chris Hornak · Steps last checked · Part of the Swift Site Audit support pages
The short answer
robots.txt is a short text file at yoursite.com/robots.txt. It tells search engines which parts of your site they may crawl. One line, Disallow: / under User-agent: *, tells every search engine to stay out of the whole site. Change that rule so your pages are allowed, then ask Google to read the file again. robots.txt controls crawling, not what shows in search. To hide a page from search, use a noindex tag.
Open yoursite.com/robots.txt in your browser to see your file. Each group starts with User-agent, the search engine it is for. * means every search engine. Each Disallow line names a part of the site that search engine should not crawl.
A healthy file for a small business site can be this short:
User-agent: *
Disallow: /admin/
Sitemap: https://example.com/sitemap.xml
The audit and Google Search Console use different words for this. The audit reads your one robots.txt file for the whole site. Search Console's Blocked by robots.txt status names one page that a rule blocks. Either way, the fix is the same: find the rule and change it.
What the audit found
The audit reads the page you tested. Find the line your report shows, then jump to its fix.
- Your robots.txt blocks every search engineCrawl permissions · robots.txt blocks all crawlers
- Your robots.txt blocks Google, Bing or AppleCrawl permissions · robots.txt blocks googlebot
- Your robots.txt blocks styles or scriptsCrawl permissions · robots.txt blocks some CSS or JavaScript files
- No robots.txt fileCrawl permissions · No robots.txt found
Your robots.txt blocks every search engine
Your report says: Crawl permissions · robots.txt blocks all crawlers
The file has Disallow: / in the User-agent: * group. / means every page, so every search engine is told to stay out of the whole site. Google can still list a blocked address if other sites link to it, but without a description. This rule is common on a site that is still being built, and it sometimes stays on after launch.
User-agent: *
Disallow: /User-agent: *
Disallow:
Sitemap: https://example.com/sitemap.xmlFix: change Disallow: / to Disallow: with nothing after it, which allows everything. Keep any lines that block private areas, such as /admin/.
Your robots.txt blocks Google, Bing or Apple
Your report says: Crawl permissions · robots.txt blocks googlebot
The file has a group just for one search engine, with Disallow: / in it. Googlebot is Google's crawler, Bingbot is Bing's and Applebot is Apple's. A search engine follows the group that names it and skips the User-agent: * group. So a Googlebot group with Disallow: / shuts Google out, even when the rest of the file allows everything.
User-agent: Googlebot
Disallow: /
User-agent: *
Disallow: /admin/User-agent: *
Disallow: /admin/Fix: delete that group, or change its Disallow: / to Disallow:. If the group holds other rules you still want, keep those lines.
Your robots.txt blocks styles or scripts
Your report says: Crawl permissions · robots.txt blocks some CSS or JavaScript files
A Disallow line blocks .css or .js files. Google loads a page's styles and scripts to see it the way a visitor does. If it can't, it may miss parts of the page that scripts add. The audit marks this as a warning, because Google can often still read the page.
User-agent: *
Disallow: /admin/
Disallow: /*.css$
Disallow: /*.js$User-agent: *
Disallow: /admin/Fix: delete the Disallow lines that name .css or .js files, or the folders that hold them.
No robots.txt file
Your report says: Crawl permissions · No robots.txt found
Nothing is blocked. Google's help says: "Not having a robots.txt file is fine, and means that Google can crawl all URLs on your site." A file is still worth having, because it can point search engines to your sitemap. One thing to check: if yoursite.com/robots.txt shows a server error instead of a "not found" page, ask your host to fix it. Google slows or stops crawling a site whose robots.txt gives server errors.
404 Not FoundUser-agent: *
Disallow:
Sitemap: https://example.com/sitemap.xmlFix: optional. Add a short file that allows everything and lists your sitemap. WordPress, Shopify, Squarespace and Framer make one for you.
Make the change on your platform
Plain code shows first. Pick your platform and we remember it on every support page.
Plain code
A plain file
The file must be named robots.txt and sit at the top of your site, at https://example.com/robots.txt. A file in a folder is ignored. Each domain and subdomain has its own.
Next.js
Put robots.txt in the app folder, or make one in code:
// app/robots.ts
import type { MetadataRoute } from 'next'
export default function robots(): MetadataRoute.Robots {
return {
rules: { userAgent: '*', allow: '/', disallow: '/admin/' },
sitemap: 'https://example.com/sitemap.xml',
}
}
Look for disallow: '/' here. A rule like userAgent: ['Bingbot'], disallow: ['/'] blocks that search engine.
Source: Google Search Central: Create a robots.txt file · Next.js: robots.txt
WordPress
Yoast SEO
- Go to Yoast SEO › Tools › File editor.
- Find
Disallow: /and change it toDisallow:, or delete the line. Save.
No File editor? Your site has file editing turned off. Edit the file through your host instead (see No SEO plugin).
When Yoast creates the file, it allows all search engines and lists your sitemap.
Rank Math
- Go to Rank Math SEO › General Settings › Edit robots.txt. You need Advanced Mode, set on the Rank Math dashboard.
- Remove
Disallow: /and click Save Changes.
Can't edit it? A real robots.txt file on your server overrides Rank Math. Delete that file through your host, then edit here.
Watch for: if Settings › Reading › Discourage search engines from indexing this site is ticked, Rank Math fills the editor with Disallow: /. Untick that box first, and don't save that text.
Source: Rank Math: Edit robots.txt with Rank Math · Rank Math: Common robots.txt issues
No SEO plugin
Good to know: WordPress makes a robots.txt for you. It blocks only /wp-admin/. The Discourage search engines box no longer changes this file. Since WordPress 5.3 it adds a noindex tag instead.
So a Disallow: / on WordPress comes from a real robots.txt file someone uploaded, or from a plugin.
- Open your host's file manager, or connect by FTP.
- In the site's main folder, open
robots.txt. Fix the rule, or delete the file to go back to the WordPress default.
Source: WordPress: Reading Settings · Yoast: The robots.txt file in Yoast SEO
Squarespace
Good to know: every Squarespace site uses the same robots.txt, and you can't edit it. It blocks only pages for internal use or duplicate content, such as /config/ and /search. Squarespace says a Search Console note about those pages is normal.
Blocks all crawlers
- Open Settings › Crawlers.
- Uncheck Block Search engine crawlers. This box is what adds
Disallow: /.
Source: Squarespace: Hiding your site from search results · Squarespace: Understanding Google SEO emails and console errors
Shopify
Good to know: every Shopify store has a default robots.txt that Shopify keeps up to date. A blocking rule comes from a theme file called robots.txt.liquid. Shopify warns: "Incorrect use of the feature can result in loss of all traffic."
Go back to the default (simplest)
- Go to Online Store › Themes, click the actions menu (…) and choose Edit code.
- In templates, right-click
robots.txt.liquidand choose Delete permanently.
An old robots.txt.liquid can also keep rules Shopify no longer uses, such as Disallow: /search. Deleting it fixes that too.
Or edit it
Open robots.txt.liquid, remove the blocking rule and save. Shopify support can't help with edits to this file.
Source: Shopify Help: Editing robots.txt.liquid · Shopify.dev: Customize robots.txt
Webflow
- Go to Site settings › SEO › Indexing.
- In the robots.txt rules, change
Disallow: /toDisallow:. Webflow's help says a robots.txt can't be fully removed, but you can replace the rules with ones that allow crawling. - In the same section, check the Traffic control switches. Turning off search engine crawlers asks them not to crawl your site.
- Save and publish.
Your free webflow.io address has its own setting, Staging indexing. Blocking that one doesn't affect your real domain.
Source: Webflow Help: Set robots.txt rules · Webflow Help: Webflow staging subdomain
Framer
Good to know: Framer makes a robots.txt for every published site, with your sitemap in it.
A blocking rule on Framer comes from a custom file someone uploaded (Pro or Enterprise plans). Framer's own guide warns to check for leftover Disallow rules from a test site.
- Open your domain's Files settings, where custom files are uploaded.
- Fix or remove the custom
robots.txt, then publish again.
Source: Framer Help: Access your robots.txt file · Framer: WordPress to Framer SEO guide
HubSpot
- Click the settings icon in the top bar. In the left sidebar, go to Content › Pages.
- Choose your domain, or Default settings for all domains.
- Open the SEO & Crawlers tab and find Robots.txt.
- Remove the
Disallow: /line and click Save.
Only domains connected to HubSpot use this file.
Source: HubSpot: Prevent content from appearing in search results
Payload or Sanity
Payload
Good to know: Payload has no robots.txt setting. The file comes from your site's code. Payload's website template builds it with a file called next-sitemap.config.cjs. Other sites use app/robots.ts (see the Code tab). Ask your developer to change the rule.
Source: Payload: How to create a robots.txt file · Payload: Page metadata
Sanity
Good to know: Sanity has no robots.txt setting. The file comes from your site's code. On a Next.js site, see the Code tab, or ask your developer.
Source: Next.js: robots.txt
Check it worked
- Open
yoursite.com/robots.txtin your browser. Check that noDisallow: /sits underUser-agent: *or under a search engine's name. - Run the Swift Site Audit again. The Crawl permissions line should pass.
- In Google Search Console, open the robots.txt report. Click the more settings icon next to your file and choose Request a recrawl. Google usually keeps a copy of the file for up to 24 hours. This report works only for domain-level properties.
- To test one page, open URL Inspection in Search Console and inspect it. Google says this tells you whether robots.txt blocks that page.
Common mistakes
- Using robots.txt to hide a page. Google says robots.txt is for crawling, and to use noindex to keep a page out of search results. See Fix a noindex tag.
- Blocking a page that has a noindex tag. Google has to crawl the page to read the noindex. Block it in robots.txt and the tag is never seen.
- A server error on the file. If robots.txt gives a server error, Google stops crawling the site for the first 12 hours and keeps trying. A missing file is fine. A broken one is not.
- The wrong name or place. It must be called
robots.txtand sit at the top of the domain. Google ignores a file anywhere else.
Fix it yourself, or have us do it
Related
- Fix a noindex tag: the right way to keep a page out of search
- Fix your canonical tag: tell Google which address is the main one
- How to audit your website like a buyer would: why search is the first step of a buyer's visit
Sources
Official documentation only. Each link was opened and read on December 3, 2026.


