Skip to content
Web and HTTP2 min read

What is a robots.txt file?

Short answer

robots.txt is a plain-text file at the root of a site (example.com/robots.txt) that tells search engine crawlers which paths they may and may not crawl. It only controls crawling: it doesn't stop a page from appearing in search results and it doesn't protect anything.

ArabyHost teamLast updated: ShareWhatsAppXLinkedIn
Contents
  1. Syntax
  2. Example for a WordPress site
  3. Common mistakes
  4. On ArabyHost

Crawlers such as Googlebot and Bingbot fetch this file before they crawl a site. Its job is to spend crawl time on the pages that matter rather than admin screens, internal search results and duplicate URLs: a small but real part of SEO. The format was formally standardised as RFC 9309 in 2022.

Syntax

The file is made of groups. Each group starts with a User-agent line followed by its rules:

Directive Meaning
User-agent Which crawler the group applies to; * means all of them
Disallow A path that must not be crawled
Allow An exception inside a disallowed path
Sitemap The full URL of your XML sitemap

Paths are case-sensitive, and when rules conflict the longest (most specific) match wins. Google ignores Crawl-delay.

Example for a WordPress site

User-agent: *
Disallow: /wp-admin/
Allow: /wp-admin/admin-ajax.php
Disallow: /?s=

Sitemap: https://example.com/wp-sitemap.xml

This blocks the admin area while still allowing admin-ajax.php, which some front-end features call, keeps internal search pages out, and points crawlers to the sitemap.

To block just one crawler (for example GPTBot, which collects content for training AI models) give it a group of its own:

User-agent: GPTBot
Disallow: /

Well-known crawlers follow these rules voluntarily; malicious bots may ignore them entirely.

Common mistakes

  • A leftover Disallow: /: added on a staging site, then copied to production, and the site quietly drops out of search.
  • Blocking CSS and JavaScript: Google needs them to render the page the way visitors see it.
  • Using it for security: the file is public, so listing a “secret” path advertises it. Protect private areas with a password instead.
  • Confusing crawling with indexing: to remove a page from results, use noindex, not Disallow.

On ArabyHost

If there’s no physical robots.txt file, WordPress serves a virtual one automatically. To customise it, create the file in public_html with the File Manager in cPanel (one click from the Araby Panel), or edit it from your SEO plugin. Then open example.com/robots.txt to confirm it’s live and check the robots.txt report in Google Search Console, as covered in the Search Console setup guide.

FAQ

Does robots.txt keep a page out of Google?

No. If other pages link to a blocked URL it can still be indexed, just without a description. To keep a page out, use a noindex tag and leave the page crawlable so Google can see it.

Where does robots.txt go?

In the root folder of the exact host it applies to, which is public_html for your main domain, so it opens at example.com/robots.txt. Each subdomain needs its own file.

Does a small site need robots.txt?

Not strictly: if it's missing, everything may be crawled. It's still a handy place to list your sitemap and keep crawlers out of admin and internal search pages.

Useful? Share it with someone who needs it:WhatsAppXLinkedIn

Read next

Ready to put your idea online?

Fast, isolated hosting, support that understands you, and an AI assistant that fixes problems with you.