Knowledge Base
MilesWeb / cPanel, How-Tos

How to Block Bots with robot.txt File via cPanel?

Approx. read time : 2 min

Bot traffic is non-user traffic that can hurt your web performance significantly. It is essential to safeguard your website from abusive bot traffic and, there are a few ways to do it. In this article, you will learn to block bots using the robot.txt file with your cPanel account.

Located in the root directory of your website, robot.txt is a text file that enables the search engine bots to crawl and index your website. Apparently, it also decides what files should be accessible to the bots making its configuration essential. It is also why you can restrict these bots from indexing your website in the search engines using the robot.txt file.

To Block Bots Using Robot.txt File

1. Log in to your cPanel account.

2. Go to the FILES section and click on File Manager.

The File Manager interface will open. You will have to create the robot.txt file.

3. Click the +File button on the top left corner of the interface.

4. Enter the file name as robot.txt and click the Create new file button.

5. Locate and right-click on the robot.txt file. Select the Edit option.

The file will open for you to enter/edit its information.

6. Copy this code in the file.

RewriteEngine On
RewriteCond %{HTTP_USER_AGENT} Baiduspider [NC]
RewriteRule .* – [F,L]

This code will block the bot from the Baidu search engine.

7. Click the Save Changes button and Close the file.


With this robot.txt file, the Baidu search engine cannot use bots on your website.

Note

You can also add the bot crawler of any other search engine to the code preventing it from indexing your website.

In short, you can even block bots from other search engines with the robot.txt file by editing it via cPanel File Manager.

Prasad is a business grad specialized in Marketing. He has garnered experience as a technical content writer and a digital marketer that he brings out in his work. He likes reading classics and travel in his free time.

Trusted By Thousands of Clients & Big Businesses

We highly appreciate the kind and stellar feedback we receive from our customers. Delivering the best is our goal! MilesWeb is rated Excellent out of 5 based on reviews. Read more reviews.

Excellent
Based on reviews
2 hours ago
Perfect and Valuable Server + ...
I am using MilesWeb Servers, The main thing which I getting are continuous support over everything w...
Gunjan Makwana
4 hours ago
Milesweb is superb Hosting pro...
Milesweb is superb Hosting provider ever, their Support team is amazing!!!...
Abhishek Singh
15 hours ago
Great support in great timing...
We need urgent assistance on changes in a primary domain on our client's Cpanel accounts and reached...
Riyaju Deen
21 hours ago
Best Website Hosting platform ...
I was new on MilesWeb. And needed help on multiple areas from setting up to getting started with cre...
Harshada
1 days ago
Very quick and helpful assista...
Very quick and helpful assistance. Support person listened properly and provided a nice solution....
Narendra
1 days ago
the team is very supportive th...
the team is very supportive though at times effort needs to be made to make understand the problem s...
Suree Sharma
1 days ago
I am using miles web for 3plus...
I am using miles web for 3plus years, very quick and perfect support by the team, they helped me man...
Sri Raghav
2 days ago
The service is good...
The service is good. They are answering with patience and doing the needful as soon as possible....
MR
2 days ago
Perfect and Valuable Server + ...
I am using MilesWeb Servers, The main thing which I getting are continuous support over everything w...
Gunjan Makwana
3 days ago
Very quick and helpful assista...
Very quick and helpful assistance. Support person listened properly and provided a nice solution....
Narendra
4 days ago
positively helped me with find...
positively helped me with finding insecure content on my website causing SSL to not work properly on...
Thaviraj Junglee
4 days ago
Exceptional support, Truly Pra...
I had opted for the basic wordpress hosting plan as I intended to experiment with various plug-ins. ...
Aseem Chandna