How to Block IP Address in WordPress

How to Block IP Address in WordPress

How to Block IP Address in WordPress

How to Block IP Address in WordPress-: Do you want to block bad visitors or spam traffic from your WordPress website? 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 tell you how to block any 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 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 siteTo 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 using LionScripts Plugin-:

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 using cPanel-: 

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.

Share the Knowledge!
  • 30
  •  
  •  
  •  
  •  
  •  
  •  
  •  
    30
    Shares
Amar Patel on FacebookAmar Patel on PinterestAmar Patel on TwitterAmar Patel on Wordpress
Amar Patel
Hi, I am Amar Patel from India. Founder, Author and Administrator of wpknol.com. I am a Simple Average Man who Loves life and Love living life.Professionally I am a Mechanical Engineer. Apart from my Job, I Love to write the things around WordPress WordPress CMS.
Enter your email address: Delivered by FeedBurner
Follow us on Social Media