How to Block IP Address in WordPress

How to Block IP Address in WordPress
Do you want to block the IP address in WordPress of bad visitors or spam traffic from your WordPress website? keep reading this post, When a user is spamming, invalid clicks or copying content on your site, then the best option is to block that user’s IP address so that they cannot visit your site again. Today in this article I will explain to you how to block IP address in WordPress.

How to Block IP Address in WordPress-:

If you want to block a visitor from your WordPress site, then you can block their IP address and prevent them from visiting the site. By blocking Spam traffic, you can save Bandwidth of your site. Here I will tell you three easy methods to block the IP address so let’s start

1. Block IP Address in WordPress using .htaccess File-:

You can easily block an IP address by editing your htaccess file. If you do not know how to edit .htaccess file, you can read this article: How to edit .htaccess file in WordPress site to block any IP address from the website, add the IP address to your .htaccess file. This way,

order allow, deny
deny from 104.24.117.129
allow from all

If you want to block a lot of IP addresses on your WordPress site, then deny from [IP address], adding one after the other.

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 IP Address in between # BEGIN WordPress and  # END WordPress

2. Block IP Address in WordPress using LionScripts Plugin-:

How to Block IP Address in WordPress

The LionScripts plugin helps block spam visitors and bad IP addresses on your WordPress website. This plugin allows you to block IP addresses in two ways – Block IPs Manually and Upload IP Address (CSV Format) First, install and activate the LionScripts plugin on your site. After activating the plugin, click on LionScripts >> IP Address Blocker and add IP Address. Then click on the Save Changes button to store your settings. Now, this plugin will block the IP address you have added.

3. Block IP Address in WordPress using cPanel-: 

How to Block IP Address in WordPress

This is also a very easy way to block an IP address from a WordPress website. Simply, log into your web hosting cPanel. Then go to the Security section, then click on IP Blocker. Now add the IP address you want to block from your website and then click on the Add button. You can successfully spam using your cPanel from your WordPress website. IP is blocked.

If you like my work, Please Share on Social Media! You can Follow WP knol on FacebookTwitterPinterest and YouTube for latest updates. You may Subscribe to WP Knol Newsletter to get latest updates via Email. You May also Continue Reading my Recent Posts Which Might Interest You.

Leave a Comment