Biggest deals of the year. 30-day money-back guarantee. Limited time deals. 24/7 support. Don't miss out

Robots.TXT disallow: how does it block search engines

Nov 18, 2026 3 min Read
Robots.TXT disallow: how does it block search engines

You can block search engine crawlers from accessing specific pages, directories, or your entire website using the Disallow directive in a robots.txt file. This helps control which parts of your website search engines can crawl, reducing unnecessary requests to areas such as internal search results or filtered pages.

However, blocking crawling doesn’t guarantee that a page won’t appear in search results. Search engines may still index a URL discovered through external links, even if robots.txt prevents them from accessing its content.

In this tutorial, you’ll learn how robots.txt works, when to use Disallow rules, and how to configure them for specific search engines or all crawlers. We’ll also cover how to verify your settings and avoid accidentally blocking important pages.

What does robots.txt block?

A robots.txt file tells search engine crawlers which URLs they should or shouldn’t access on your website. It’s a plain text file stored in your site’s root directory, typically accessible at https://example.com/robots.txt.

The Disallow directive instructs compliant crawlers not to visit specified URLs. However, it doesn’t password-protect content or guarantee that blocked URLs will disappear from search results.

For example, Google may still index a blocked URL if it discovers that address through links on other websites, even without crawling its content.

When should you use robots.txt?

Use robots.txt when you want to block crawlers from accessing your entire website, reduce unnecessary crawling, or prevent compliant search engine bots from accessing specific areas of your website.

However, the correct approach depends on what you’re trying to achieve.

Your goalRecommended method
Reduce crawling of unnecessary URLsrobots.txt Disallow
Prevent a page from appearing in Google Searchnoindex meta tag or HTTP header
Protect private or sensitive contentPassword protection or access restrictions
Consolidate duplicate pagesCanonical tags or redirects

For example, if you want to exclude a page from Google Search, use noindex while keeping the page accessible to crawlers. Blocking that page in robots.txt would prevent Google from reading its noindex directive.

Similarly, don’t use robots.txt to protect staging websites containing sensitive information. The file is publicly accessible, and crawlers aren’t required to follow its instructions.

How to block search engine crawling using robots.txt

If you want to check your site’s robots.txt file, you can view it by adding robots.txt after your site’s URL, for example, www.myname.com/robots.txt. You can edit it through your web hosting control panel’s file manager, or an FTP client.

To edit robots.txt using Hostinger File Manager:

  1. Log in to your Hostinger account and navigate to Websites.
  2. Select your website and click Manage site.
  3. Go to Files → File Manager.
  4. Open the public_html directory and locate robots.txt.
  5. Edit the existing file, or create a new file named robots.txt if one doesn’t exist.
  6. Save your changes and deploy them if your File Manager requires deployment.

Before replacing existing rules, review them carefully to avoid accidentally blocking important pages or resources.

The public_html directory with the

If the file isn’t there, you can create it manually. Just click the New File button at the top right corner of the file manager, name it robots.txt and place it in public_html.

Now you can start adding commands to the file. The two main ones you should know are:

  1. User-agent – refers to the type of bot that will be restricted, such as Googlebot or Bingbot.
  2. Disallow – is where you want to restrict the bots.

Let’s look at an example. If you want to prevent Google’s bot from crawling on a specific folder of your site, you can put this command in the file:

User-agent: Googlebot 
Disallow: /example-subfolder/

You can also block the search bots from crawling on a specific web page. If you want to block Bingbot from a page, then you can set the command like this:

User-agent: Bingbot

Disallow: /example-subfolder/blocked-page.html

To ask all compliant crawlers not to access your entire website, use:

User-agent: *
Disallow: /

The asterisk applies the rule to all compliant crawlers, while / matches every URL path on the site.

Don’t apply this rule to a live website that you want search engines to crawl. It can prevent search engines from discovering updates or reading content, but it doesn’t guarantee that previously discovered URLs will disappear from search results.

You can set up different configurations for different search engines by adding multiple commands to the file. Also, keep in mind that the changes take effect after you save the robots.txt file.

How to verify your robots.txt rules

After saving your changes, open https://example.com/robots.txt in your browser and confirm that the file is publicly accessible.

Then check the configuration using the robots.txt report in Google Search Console. This helps identify whether Google can fetch the file and whether it encounters problems processing it.

Search Console only covers Google’s crawlers. To see whether your rules also block AI crawlers like GPTBot, ClaudeBot or PerplexityBot, test your site with an AI readiness checker.

If you’ve added rules to block specific directories, review their paths carefully. A misplaced slash or overly broad Disallow rule can prevent crawlers from accessing important content.

Remember that changes to robots.txt may take time to appear in crawler behavior, since search engines can temporarily cache the file.

Next steps: Review your website’s crawl settings

After configuring robots.txt, review which pages and directories you’ve restricted. Make sure search engines can still crawl the important content you want visitors to find.

If your goal is to remove specific pages from search results, use an appropriate indexing directive instead of relying on robots.txt alone.

Check Google Search Console regularly for crawling issues, especially after making major changes to your website structure.

This article is a localized version of Robots.TXT disallow: how does it block search engines, originally published in English.

Merkys is a server administrator and Linux expert. He keeps everything up & running while tackling advanced server management issues. Besides that, he’s a big fan of blockchain technology, web development, and bodybuilding.

Trusted by 4+ million website owners worldwide

See our 74,512 reviews on Trustpilot