How To Restrict Bots From Accessing Your WordPress Site?

How To Restrict Bots From Accessing Your WordPress Site? [STEP BY STEP]☑️

In this tutorial, you will learn how to restrict bot from accessing your WordPress site by making some changes in the .htaccess file.

A bot is an application that is automated and runs script over the internet. They can perform tasks faster and can do repetitive tasks at a much higher rate than human. Bots can make your life easier and sometimes it can be a nuisance. In WordPress, bots can be used to breach the security of databases, login portal, hosts, etc. Therefore it is recommended to harden your WordPress site and restrict bots from accessing your site.

Watch here short video tutorial on “How To Restrict Bots From Accessing Your WordPress Site?”

Follow the steps mentioned below to secure your site and restrict bots from accessing your WordPress site:

Step::1 Login to your cPanel and click File manager.

How To Restrict Bots From Accessing Your WordPress Site

Step::2 Go inside public_html directory where you will find the .htaccess

How To Restrict Bots From Accessing Your WordPress Site

How To Restrict Bots From Accessing Your WordPress Site

Step::3 Now, we need to restrict bots by adding some codes to the .htaccess file. Right click on .htaccess file and choose the Edit option.

How To Restrict Bots From Accessing Your WordPress Site

Add the following lines of code to your .htaccess file to restrict bots from your site

#Block Bad User Agents 
RewriteEngine On
RewriteCond %{HTTP_USER_AGENT} ^SpiderMan[OR] 
RewriteCond %{HTTP_USER_AGENT} ^voyager[OR] 
RewriteCond %{HTTP_USER_AGENT} ^WaveFire 
RewriteRule .* - [F,L]

How To Restrict Bots From Accessing Your WordPress Site

(In the above code, SpiderMan, voyager and Wavefire are the bots. These can be replaced by the bots you want to block.)

The last line of code requests the server to give a 403 error to the bots in the code.

Step::4 You can also restrict the access if you know the IP address of the bot.

You can list the IP addresses in the .htaccess file

#Restrict IP of bots 
Deny from 123.123.45.184 
Deny from 123.123.99.952 
#Restrict IP range of bots 
Deny from 123.123.123.0/24

How To Restrict Bots From Accessing Your WordPress Site

You can add the IP address or the range of IP address of the bot that you want to block.

Step::5 Finally click on Save Changes tab and Close the Editor.

How To Restrict Bots From Accessing Your WordPress Site

By following the steps mentioned, you can make your site safe from malicious bots to access your site.

For more information, kindly follow us on social media like Twitter and Facebook and for video tutorials, subscribe to our YouTube channelhttps://youtube.com/redserverhost.com

Facebook Page https://facebook.com/redserverhost

Twitter Pagehttps://twitter.com/redserverhost.com

Thanks for Reading this article !!! We hope this was helpful to you all.

If you have any suggestions or problems related to this video, please let us know via the comment section below.

Tags: cheap linux hostingbuy linux hostingcheap reseller hostingbuy reseller hostingbest reseller hostingcheap web hostingcheapest web hostingcheapest reseller hosting,  cheap reseller hostcheap linux hostcheapest linux hostingbest linux hostingbest web hosting