1800 170 681

How to Generate Robots.txt File

A robots.txt file tells crawlers what they may request. Ignoring it can waste crawl budget or hide the wrong pages. See how it works and review your own file next.

Some of our clients

If you choose to collaborate with us, you can rest assured you will be in good company - check out some of the brands that we work with.

  • GWM SEO Partner: Lavazza
  • GWM SEO Partner: Bicycles Online
  • GWM SEO Partner: DW Advisory
  • Partner 1
  • Partner 7
  • GWM SEO Partner: CW
  • Partner 12
  • GWM SEO Partner: AS
  • GWM SEO Partner: PersonalDigital
  • GWM SEO Partner: Maxi Cosi
  • GWM SEO Partner: Labdirect
  • GWM SEO Partner: Bluepod
  • GWM SEO Partner: Chatime
  • Hoselink logo1
  • Partner 2
  • Partner 8
  • GWM SEO Partner: Caredent
  • Logo oc4llplfbs5xcrg6gxaolnnm62fjhexhau2ybv3inc
  • Partner 16
  • GWM SEO Partner: Portcullis
  • GWM SEO Partner: Omnyfy
  • true

Blog

How to Generate Robots.txt File

By adminPublished 21 November 2016

How to Generate Robots.txt File

Surely, you have come across the term robots.txt when doing your research about Search Engine Optimisation (SEO). Do not ignore this because this will play a significant role in your campaign.

What is robots.txt?

The robots.txt is created by website owners like you when you do not want to allow search robots to visit your site, as well as index your content. Or, you will use this file when you find the need to block them from accessing a particular web page or web pages. Do not make a mistake of thinking that this is sort of an html code. Robots.txt is a real text. It is not even a firewall or some kind of a password protector. Anyone can still get into your site. It is just telling the good guys, the search robots, of course, not to crawl into your site or to a specific web page during the search.

When to use it?

You may want to use robots.txt file in several instances. For one, if you are keeping two versions of a web page, one for anyone to see and the other one for your eyes or for office use only. If you do not create a robots.txt file for the second one, you will definitely receive a penalty for duplication of content. Worse, everyone who comes across your site will read confidential files from your office. Another case in point is when you want to save bandwidth. You can place this in your image, style sheets and others.

Location

Which specific place in your site is the rightful location of robots.txt file? It is in the primary directory of your site and not in any subdirectory. This is very important or else, the robots will surely visit and index your site.

What the Search Robots See

Once the robots start to help online visitors from their search, they may stumble upon your site. But instead of entering, they will look for this first: http://www.yoursitename.com/robots.txt/. They will dutifully leave your site if they find this structure:

User-agent: *

Disallow: /

The “*” refers to search robots. The “/” refers to your site. Hence, this means you are preventing all crawlers from accessing the whole content of your website. But if you are blocking only a specific robot for particular content, here is the example:

User-agent: Googlebot-Image

Disallow: /

The above structure will stop the Image robot of Google from creeping into your site images; hence, it cannot make them searchable over the Internet. So, in case you do not want all robots to index your private directory, here is what you do:

Once you understand how a robots.txt file works, someone still has to own the follow-up. Pair that writing with technical SEO services that keep templates clean, fast and eligible to rank.

User-agent: *

Disallow: /privatedir/

What if you prevent all search engines to crawl into your private directory for instance except for Google? Check this arrangement:

User-agent: *

Disallow: /

User-agent: Googlebot

Disallow: /privatedir/

Remember, we are preventing the SEARCH robots from accessing your website and not the other robots like malware and email harvesters. Anyone may still visit your site. You only post the “No Entry” sign so other “bad guys” will still come in if they want to. This is close to saying that you do not rely on robots.txt if your main goal is to hide some pieces of information. Instead, construct your server in such a way that it will perform authentication and ask it to do proper authorisation.

latest news

Switching to GWM

Move to GWM. Save more. Pay later.

  1. 30 to 40%

    Switch and save 30 to 40%

    Clients typically save 30 to 40% moving their SEO or Google Ads to GWM, and gain a broader team and more services.

  2. Done for you

    We handle the move

    Account access, tracking and campaign handover. We take care of the switch.

  3. Jan 2027

    Try us before you pay

    Start now. Happy to continue? Your first GWM payment starts in January 2027.

Contact Us

So, have we got your attention? Do you feel as though we could be exactly what you’re looking for? If so, get in touch with us. Send your inquiry to us, and a friendly member of the team will get back to you as soon as possible. Or, if you would rather not wait for an email and would like to call us directly, we encourage you to do so.

Our offices are in Melbourne, Sydney, Brisbane and Europe, so we encourage you to get in touch with the office that you think will work best for you based on your location. If you’re a little phone shy, don’t worry, our team is super friendly and will make you feel at ease within seconds, we don’t bite!

1800 170 681

Work with us

Please selectSEOPPC/Google AdwordsWeb Design & DevelopmentSocial Media Marketing

Your Budget 1k to 2k, 2k to 3k, 3k to 4k, 4k to 5k, or 5k plus

FAQ

  • Robots.txt is a small text file at the root of your site that tells search engine crawlers which areas they can and can't crawl. It's useful for keeping bots out of admin areas or duplicate sections. It does not hide pages from search results on its own, so use noindex for that.

1,000+

Trusted by 1,000+ businessesSmall and medium businesses have trusted GWM since 2016.

  • Outrank the biggest names
  • Switch and save 30 to 40%
  • Try us before you pay
  • A new website, included
  • Your own graphic designer
  • Redesigns built for enquiries
  • Talk straight to the engineers
  • One team. No revolving door.
  • SEO + Google Ads, one team
  • Ready for AI search
  • Your own AI agent, free
  • We handle the move
  • More done. One campaign.