A law firm website can look perfect to every visitor and still be invisible to search engines, because the instructions that keep crawlers out never show on the page. They sit in a small file called robots.txt, in a tag in the page's code, or behind a checkbox in your website builder's settings. Very often they were switched on deliberately while the site was being built and never switched off.
This guide covers the blocks your own site creates: what each kind of block actually does, the platform settings that hide whole sites, how to read a robots.txt file, which AI crawlers to allow, and how to test all of it. If Google can reach your pages but has decided not to index them, that is a different problem, covered in our guide to why Google isn't indexing your law firm's pages.
robots.txt, noindex and passwords do different jobs
There are three common ways to keep search engines away from a page, and mixing them up causes most of the damage.
| Method | Stops crawling? | Stops indexing? |
|---|---|---|
| robots.txt Disallow rule | Yes, for crawlers that obey it | No. The address can still be indexed from links. |
| noindex meta tag or X-Robots-Tag header | No | Yes, once Google recrawls the page and sees it |
| Password or login | Yes | Yes |
Each has its own job. A Disallow rule suits low-value areas such as internal search results. A noindex tag suits confirmation pages, thin archives and pages kept for visitors only. A password belongs on staging sites, client portals and anything confidential.
Three points follow from Google's own documentation. First, robots.txt manages crawling and is not a way to keep a page out of Google. A blocked URL can still appear in results, usually without a description, if other pages link to it, and Search Console reports that as "Indexed, though blocked by robots.txt". Second, a noindex directive only works if Google is allowed to crawl the page and see it, so a page that is both disallowed and tagged noindex can stay in results because the tag is never read. Third, Google does not support a noindex line inside robots.txt. It has to be on the page or in the HTTP response header.
The practical rule follows. If you want a page out of Google, let Google crawl it and give it a noindex tag, or remove it and return a 404 or 410. Use robots.txt to manage crawling, not to hide things. And if two versions of a page are competing, the fix is a canonical tag or a redirect rather than a block; our guide to canonical URLs and duplicate content explains why.
Platform settings that hide an entire site
Each website builder has a switch for hiding a site from search engines, and developers often turn it on during a build. The labels below were current when this guide was written; if yours look different, check your platform's help center.
- WordPress. Under Settings, then Reading, there is a box labeled "Discourage search engines from indexing this site". Since WordPress 5.3 it adds a noindex, nofollow robots tag to every page rather than a robots.txt rule, and WordPress notes that it is up to search engines to honor the request.
- Squarespace. The Crawlers panel in Settings has an option to block search engine crawlers, which adds a site-wide Disallow rule to robots.txt. Individual pages have a "Hide page from search results" toggle in their SEO settings, which adds a noindex tag instead. The same Crawlers panel has a separate option for blocking known AI crawlers.
- Wix. The SEO settings in the site dashboard include a "Let search engines index your site" toggle. When it is off, the site asks search engines not to index it.
- Webflow. The webflow.io staging address has its own staging indexing setting, which publishes a blocking robots.txt only on that subdomain. Make sure it is the staging copy that is blocked and not your custom domain.
Two other site-wide blocks regularly catch firms out.
- A password left on after launch, or the reverse. A staging copy on a public subdomain with no password can get indexed and compete with the real site. Password-protect staging sites rather than relying on robots.txt alone.
- Security and bot-protection settings. Firewall rules, security plugins and "block bots" options at your host or content delivery network can serve Googlebot or AI crawlers an error or a challenge page. In Search Console this shows up as "Blocked due to access forbidden (403)" or as server errors. Google points out that Googlebot never sends credentials, so a 403 response to Googlebot on a public page is a misconfiguration.
How to read a robots.txt file
Your robots.txt lives at the top level of your domain, for example https://www.yourfirm.com/robots.txt, and you can open it in any browser. Its rules apply only to that exact host and protocol, so a blog or intake form on a subdomain needs its own file. A typical law firm file looks something like this.
# Rules for every crawler that honors robots.txt
User-agent: *
Disallow: /wp-admin/
Allow: /wp-admin/admin-ajax.php
Disallow: /search/
Sitemap: https://www.yourfirm.com/sitemap.xml
Each kind of line does one job.
- User-agent names the crawler a group of rules applies to. The asterisk stands for every crawler that does not have a group of its own.
- Disallow gives a path the crawler should not fetch. Paths match from the start of the URL and are case-sensitive, so /Practice-Areas/ and /practice-areas/ are different paths.
- Allow carves out an exception inside a disallowed path.
- Sitemap tells crawlers where your XML sitemap is. It is optional but worth including, and our sitemap guide covers the sitemap itself.
A few rules about how Google reads the file regularly trip people up.
- When rules conflict, Google follows the most specific one, meaning the longest matching path. If two are equally specific, it uses the less restrictive one.
- A crawler obeys only the group that names it most specifically and ignores the rest. Add a group for Googlebot with a single rule, and Googlebot stops following everything in the asterisk group.
- Google ignores lines it does not support, including crawl-delay and noindex.
- Google generally caches robots.txt for up to 24 hours, so a fix can take a day to register.
- If robots.txt returns a 404, Google assumes there are no restrictions. If it returns a server error, Google stops crawling the site for the first 12 hours, then falls back to its last cached copy for up to 30 days. An unreliable server can pause crawling even when the file itself is fine.
Mistakes that hide law firm pages
- A Disallow: / line left over from development. A single slash after Disallow blocks the entire site. It is the classic post-launch mistake and the first thing to check after any redesign.
- Prefixes that block more than intended. Because paths match from the start, Disallow: /p blocks /practice-areas/, /personal-injury/ and /privacy-policy/ alike. Write the full folder name with its trailing slash.
- Blocked CSS and JavaScript. Google renders pages much as a browser does, and it will not run JavaScript from blocked files. Blocking theme, plugin or asset folders can leave Google with a broken or empty version of your practice pages. Google advises against blocking any resource it needs to understand a page.
- Using robots.txt to remove a page that is already indexed. If an old attorney bio or a retired service page is in Google and you disallow it, Google can no longer see the 404 or the noindex tag that would remove it. Let it be crawled until it drops out. For anything urgent, the Removals tool in Search Console hides a URL for about six months while the permanent fix takes effect.
- Forgetting other hosts. The www and non-www versions, an old domain that still serves content, and every subdomain each answer for their own robots.txt.
Here is the file that hides a whole site from every crawler that follows the rules.
User-agent: *
Disallow: /
An empty Disallow line, by contrast, allows everything, so a single missing slash is the entire difference between a visible site and an invisible one.
User-agent: *
Disallow:
AI crawlers: what each one does and what blocking it changes
AI companies run several crawlers, and they do not all do the same job. Some collect material for training models. Others fetch pages so an assistant can cite and link to them in its answers. Blocking a training crawler and blocking a search crawler have very different effects on whether your firm comes up when someone asks an assistant for a lawyer. The descriptions below come from each company's own documentation.
- OpenAI. OAI-SearchBot surfaces sites in ChatGPT's search features, so blocking it keeps your pages out of those answers, apart from plain navigational links. GPTBot collects content that may be used to train OpenAI's models, and OpenAI says the two settings are independent, so blocking GPTBot does not by itself remove you from ChatGPT search. ChatGPT-User visits pages when a user asks ChatGPT to, and OpenAI says robots.txt rules may not apply to those user-initiated visits.
- Anthropic. ClaudeBot collects content that may be used for training. Claude-SearchBot indexes content to improve Claude's search results, and Claude-User fetches pages when a user asks. Anthropic says blocking either of those two may reduce your visibility in Claude's answers.
- Perplexity. PerplexityBot surfaces and links sites in Perplexity's answers and, according to Perplexity, is not used to train foundation models. Perplexity-User handles visits a user asked for and, by Perplexity's own description, generally ignores robots.txt.
- Google. Googlebot crawls for Search, and that includes AI Overviews and AI Mode. Google says no special file or markup is needed to appear in those features beyond being indexed and eligible to show a snippet. Google-Extended is not a separate crawler but a robots.txt token. It controls whether content Google has crawled is used to train Gemini models and to ground answers in the Gemini app, Google's own AI assistant, as well as in some of Google's tools for developers. Google says it does not affect a site's inclusion or ranking in Google Search.
- Apple. Applebot powers search features in Siri, Spotlight and Safari. Applebot-Extended does not crawl at all. It tells Apple whether content Applebot collected may be used to train Apple's models, and pages that disallow it can still appear in Apple's search results.
- Microsoft. Bingbot crawls for Bing, and Microsoft Copilot answers questions about the web by sending searches to Bing. A site Bing cannot crawl is therefore unlikely to be used in Copilot's web answers either. Our Bing Webmaster Tools setup guide is the place to confirm that Bing can reach your site.
Should a law firm block AI crawlers?
If you want AI assistants to recommend your firm, the search and user-facing crawlers should stay allowed: OAI-SearchBot, ChatGPT-User, Claude-SearchBot, Claude-User and PerplexityBot, along with Googlebot, Bingbot and Applebot. Allowing everything is the simplest setup when visibility is the priority. Blocking the training-only tokens, which are GPTBot, ClaudeBot and Applebot-Extended, is a business decision about how your content is used. Going by each company's own documentation, it does not remove you from their search features.
Google-Extended needs more thought. Blocking it opts your content out of Gemini training, but it also stops your content being used to ground answers in the Gemini app, which is itself an AI assistant a prospective client might ask for a lawyer. Google says the token does not affect inclusion in Google Search, which is where AI Overviews and AI Mode appear, so a Google-Extended block leaves your regular search visibility alone while narrowing your reach in Gemini.
Make these choices on purpose rather than inheriting them from a default. Some website builders, security plugins and content delivery networks now offer one-click AI blocking, and the lists of crawlers they cover differ from one product to the next. Check exactly which user agents a setting covers before you switch it on. Remember too that robots.txt is a request. Google states that reputable crawlers obey it but that the file cannot enforce anything, so it is no substitute for a password on anything confidential. Changes also take time to register: OpenAI, for example, says its search systems can take about 24 hours to adjust after a robots.txt update.
If your firm decides to opt out of model training by OpenAI, Anthropic and Apple while leaving the search and user-facing crawlers open, the file might look like the example below. It is an illustration, not a recommendation for every firm. It leaves out Google-Extended on purpose. Add a group for that token only if your firm also accepts that its content will stop grounding answers in the Gemini app.
# Illustrative: opt out of OpenAI, Anthropic and Apple model training
# Search and user-facing crawlers are not listed, so they stay open
User-agent: GPTBot
Disallow: /
User-agent: ClaudeBot
Disallow: /
User-agent: Applebot-Extended
Disallow: /
# Every other crawler, including Googlebot, Bingbot, OAI-SearchBot and PerplexityBot
User-agent: *
Disallow: /wp-admin/
Allow: /wp-admin/admin-ajax.php
Sitemap: https://www.yourfirm.com/sitemap.xml
Crawler access is only the first step to being cited. Our AI visibility hub for law firms covers the content side, and the guide to structured data for AI search covers the markup that helps assistants understand what your firm does.
How to test your setup
- Open the file. Visit /robots.txt on your main domain, on the www or non-www alternative, and on any subdomain you use. Look for a lone Disallow: / and for folder names you recognize as important.
- Use the robots.txt report in Search Console. Found under Settings, it lists the robots.txt files Google found for the top 20 hosts on your site, when each was last checked, whether the fetch succeeded, and any errors or warnings. After fixing an urgent mistake, you can request a recrawl of the file from the same report. It replaced the older robots.txt Tester in late 2023, so instructions that send you to "the tester" are out of date.
- Inspect individual pages. The robots.txt report does not test single URLs. For that, run URL Inspection on your key pages, read the "Crawl allowed?" and "Indexing allowed?" lines, and use the live test to check the page as Google sees it today.
- Watch the Page indexing report. A sudden rise in "Blocked by robots.txt" or "Excluded by 'noindex' tag" after a site update is the earliest sign that something shipped by mistake.
- Check the code of key pages. View the source of your homepage and main practice pages and search for "noindex". Ask your developer to confirm that no X-Robots-Tag header is being sent on public pages.
- Test rule changes before publishing them. Google's report only reads the live file. Bing Webmaster Tools added a robots.txt tester in 2020 that checks a URL against an edited copy of your rules, so your developer can catch a mistake before it goes live.
The robots.txt report is only available for a domain-level property, meaning a Domain property or a URL-prefix property at the root of the site. If your firm's property covers only a subfolder, our Search Console setup guide explains the property types and how to add the right one.
A launch and redesign checklist for your developer
Hand these questions to whoever builds or maintains your site, and ask them again after every redesign, platform move or hosting change.
- Does the live robots.txt allow crawling of every public page, with no leftover Disallow: / line?
- Is the platform's "hide from search engines" or "discourage search engines" setting off on the live site?
- Is the staging site password-protected, not just disallowed?
- Do CSS, JavaScript and image folders load for Googlebot, and does the URL Inspection live test show the page fully rendered?
- Are public pages free of stray noindex tags and X-Robots-Tag headers?
- Does the Sitemap line point to the live domain's sitemap?
- Are the AI crawler rules a deliberate choice, and does the firewall let verified search crawlers through?
- Who will check the robots.txt report and the Page indexing report a week after launch?
Where LexGrow fits
Crawl access is among the first things a LexGrow audit looks at, because one wrong line can undo every other investment in a site. Our on-page and technical SEO for law firms keeps crawl and index settings correct through redesigns and platform changes, alongside the content and structure that help your firm get found in search and in AI answers.