Mobile app version of vmapp.org
Login or Join
Carla537

: User-agent line needed in robots.txt? I'm about to deploy a website for testing and I want to let all the indexing bots to not index my site during this phase. According to Google Webmasters

@Carla537

Posted in: #GoogleSearchConsole #RobotsTxt #Seo

I'm about to deploy a website for testing and I want to let all the indexing bots to not index my site during this phase.

According to Google Webmasters Help section apparently you only need the following in your robots.txt file:

Disallow: /


But according to www.robotstxt.org/faq/prevent.html and other sources you have to write it like this:

User-agent: *
Disallow: /


I'm afraid that the bots still will index my site if I leave the User-agent: * part out.

So which is the proper way to do it?

10.02% popularity Vote Up Vote Down


Login to follow query

More posts by @Carla537

2 Comments

Sorted by latest first Latest Oldest Best

 

@Ogunnowo487

The original robots.txt specification is www.robotstxt.org/orig.html, where it says:


The record starts with one or more User-agent lines […]


So yes, User-agent is required.

10% popularity Vote Up Vote Down


 

@Gretchen104

As far as I know and as far as I have search for it, there is no robots.txt documentation saying you can drop the user-agent line. I would not rely on this.

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme