GoAdmio Command Line: robots with /go/robots

A robots.txt file tells search engines and other crawlers which parts of a site they may visit. /go/robots writes one for every hosting account on the server in a single run. For each domain with a /home/<domain>/www folder, it creates /home/<domain>/www/robots.txt. The command doesn't need sudo. If you aren't root, it runs itself again with sudo. Every admin action in GoAdmio has a matching /go/ command, so anything you can click you can also script.

Quick start

# Create the standard robots.txt for all domains
/go/robots

# Also block several SEO crawlers
/go/robots block

Options

Argument Required Notes
block No Adds rules that block six crawlers from the whole site.

Any other argument is ignored.

Examples

# Standard robots.txt for all domains
/go/robots

# Standard file plus the crawler blocks
/go/robots block

# Check the result
curl https://example.com/robots.txt

Output

Creating a robots.txt File for example.com...
Creating a robots.txt File for example.org...

There is one line for each domain. The command prints nothing else, and its exit status is 0.

Every run is logged to /var/log/go/robots.log with a timestamp and the arguments used.

The file it writes

Without block:

User-agent: *
Disallow: /admin/

Sitemap: https://www.example.com/sitemap.xml

With block, these rules are added after the lines above, one block for each crawler:

User-agent: Amazonbot
Disallow: /

The crawlers are Amazonbot, PetalBot, DataForSeoBot, serpstatbot, dotbot, and SemrushBot.

See the full reference at /go/robots and the GoAdmio command index.

GoAdmio is free and open source, with no license fees and no account limits. Read the GoAdmio docs, or see why it is a free cPanel alternative at goadmio.com.

By:

Posted in:


Leave a Reply

Your email address will not be published. Required fields are marked *