The Wayback Machine - https://web.archive.org/web/20240624152834/https://www.geeksforgeeks.org/robots-txt-file-in-seo/
Open In App

Components of Robot.txt File – User-Agent, Disallow, Allow & Sitemap

Last Updated : 09 Nov, 2023
Improve
Improve
Like Article
Like
Save
Share
Report

The robots.txt file in SEO acts as a gatekeeper, before any good bots entering to your website they first visit the robots.txt file and read which pages are allowed to crawl and which are not.

A robots.txt file tells the Google crawler bot which URLs the crawler can access on your website.

Example of Robot.txt File

You can also visit our robots.txt file by this URL: https://www.geeksforgeeks.org/robots.txt

User-agent: *
Disallow: /wp-admin/
Disallow: /community/
Disallow: /wp-content/plugins/
Disallow: /content-override.php
User-agent: ChatGPT-User
Disallow: /

Components of Robot.txt File

Now lets explain above code

  • User-agent means bots.
    • * means all.
  • Disallow means if the URL contains this keyword don’t crawl.

For example:

If we put Disallow on the URL https://www.geeksforgeeks.org/wp-admin/image.jpg and do not allow it to be crawled.

Now even if the URL is changed to https://www.geeksforgeeks.org/news/wp-admin/image.jpg
then also https://www.geeksforgeeks.org/new/wp-admin/image.jpg is not allowed to crawl (although https://www.geeksforgeeks.org/news is allowed to crawl).

  • User-agent: ChatGPT-User
    • blocks the ChatGPT bot from crawling the whole website.

User-agent: *
Disallow: /

Above code block all web crawler to visit any page of website.

Note: If you want any URL to deindex from Google Search quickly you can use Google Search Console removal request from your GSC account.


Previous Article
Next Article

Similar Reads

What is Robots.Txt File | Importance, Role, and Impact on SEO
A Robots.Txt File is a simple text file that instructs web crawlers about which parts of a website are open for indexing and which should remain off-limits. Robots.Txt File, located in a website's root directory, guides search engine crawlers on what to index and what to ignore. It plays a crucial role in shaping a website's presence in search resu
11 min read
Explain Sitemap with Advantages Disadvantages and their Types
A sitemap is a file that lists the pages, videos, and other files on your website, as well as their relationships. Search engines (such as Google, Duckduckgo, Bing, and others) use this file to help them crawl your site more efficiently. Sitemaps, as the name implies, is a map of your website that displays the structure of your site, its sections,
4 min read
How to Disable the Default WordPress Sitemap?
An XML sitemap is a file that contains a list of all the content on your website, in XML format. This makes it easy for search engines to find and index your material, which can increase traffic and improve your SEO results. However, some WordPress SEO plugins, like All in One SEO, Yoast SEO, and Google XML Sitemaps, already include sitemaps. This
6 min read
9 Best Sitemap Generator Tools (Free & Paid)
When it comes to managing websites, the most important task is to keep everything organized. Sitemaps to generate tools help to organize your search engine so people and search engines can find it easily. A clear sitemap is really important for your website to make it user-friendly and increase its insights. In this article, we will learn about the
8 min read
Does Google allow businesses to pay for search engine optimization (SEO)?
No, Google does not allow businesses to pay for search engine optimization (SEO) services. SEO involves optimizing a website to enhance its visibility in search engine results pages (SERPs), and while businesses may seek assistance from SEO agencies or professionals, paying for certain types of SEO that manipulate search engine rankings is strictly
1 min read
E-E-A-T in SEO | Importance, Components, and How is it evaluated?
E-E-A-T in SEO stands E-E-A-T stands for "Experience, Expertise, Authoritativeness, and Trustworthiness" .Google does not give priority to content that will make your life more difficult, despite the appearance that they do. They rank material in order to provide the best answers or solutions to its customers' queries. They care about it because th
8 min read
Components of Search Engine
A search engine typically comprises several key components that work together to index, retrieve, and present relevant information to users. Here are the main components of a search engine: Table of Content 1. Web Crawling Component of Search Engine:2. Indexing Component of Search Engine:3. Ranking Algorithm Component of Search Engine: 4. Query Pro
15+ min read
What is User Engagement | How to Measure it ?
Simply having users isn't enough. You need them to be actively engaged, participating in a way that benefits both them and you. Here's a deep dive into User Engagement, packed with valuable information and actionable strategies: What is User Engagement?User engagement refers to the level of meaningful interaction users have with your product, servi
2 min read
User Engagement Metrics in SEO
User engagement metrics in SEO refer to the various indicators that measure how users interact with a website's content and overall user experience. These metrics provide valuable insights into how users engage with a website, the quality of its content, and its relevance to their search queries. Analyzing user engagement metrics helps website owne
3 min read
How User Behavior In Search Works?
User behavior in search is a fascinating and complex topic, with its very small details affects both searchers and the websites they land on. Here's a breakdown of key points: From the searcher's perspective Query formulation: People often start with short, simple queries and refine them based on results (15% refine their terms). Autocomplete sugge
3 min read