Do you want to block bad visitors or spam traffic from your WordPress website? Some users (Competitor) use your site incorrectly to decrease search ranking or click on Adsense ads to disable your AdSense account. Therefore blocking the user’s IP address is the best option so they can not access your site. Today in this article we will tell you how to block an IP address from your website.
Brief Descriptions of The Content
How to Block a Specific IP Address from Accessing Your Website
If you want to block a visitor from your WordPress site then block their IP Address. By blocking the Spam IP Addresses and bad traffic, you can save your site’s bandwidth. Here we will tell you three simple methods to block a specific IP address from accessing your website.
1. Restrict Access to Website by IP Address
You can easily block IP address by editing your .htaccess file. If you are not familiar with editing the .htaccess file, you can read our article: how to edit .htaccess File in WordPress
To block the IP address from your website, add the IP address to the .htaccess file. Like this,
order allow,deny
deny from 104.24.117.129
allow from all
You can see the screenshot below.

Replace your IP address with IP address 104.24.117.129.
If you want to block multiple IP addresses, then add the IP address with deny from [IP address].
For example,
order allow,deny
deny from Your IP Address
deny from Your IP Address
deny from Your IP Address
deny from Your IP Address
allow from all
Note: Do not add your IP address between # BEGIN WordPress and # END WordPress Lines.
So in this way, you can block IP address from accessing your website by editing .htaccess file.
2. Block IP Address Using LionScripts plugin
LionScripts plugin helps to block spam visitors and bad IP addresses from your WordPress website. The plugin allows blocking any user from accessing your website by using the manual method or the Bulk IPs Upload method.
First, install and activateLionScripts plugin on your site. After activating plugin click onLionScripts >> IP Address Blockerand add your IP Address. After that click on Save Changes to store your settings.

Now, this plugin will block IP address you added.
3. Block IP Address Using cPanel
This is also another easy way to block an IP address from your website. Simply, log in to your web hosting cPanel and scroll down to Security section, then click on IP Blocker.

Now add the IP address that you want to block from your website and hit on Addbutton.

You have successfully blocked spam IP from your website using cPanel.
We’re done, and it’s now your turn! Find this article helpful? Don’t forget to share!
Leave a Reply