How to Block IP Addresses in WordPress
Every computer has a unique Internet protocol, or IP, address. This address is a numerical sequence used to identify the computer on a network. If your WordPress blog or website contains sensitive information, or if your site is attacked by harassing or hurtful commentary, you can block a certain computer from connecting to your WordPress site. With some special coding in your WordPress site's root directory, you can permanently block individual IP addresses.
Instructions
-
-
1
Open your computer's text editor. Text editors are more simplistic than word processors, featuring limited formatting and font options. On a Windows computer, the default text editor is called Microsoft Notepad.
-
2
Type "Order allow, deny" on the first line of the text editor. Do not enter the quotation marks when typing this line or any line of the code sequence.
-
-
3
Press the "Enter" key on your keyboard.
-
4
Type "Deny from."
-
5
Press the space bar, and type in the IP address you want to block.
-
6
Repeat Steps 3 through 5 to block additional IP addresses.
-
7
Press the "Enter" key, and type "Allow from all."
-
8
Click "File" and "Save As," and save the text file as ".htaccess."
-
9
Open the FTP program you use for WordPress site or blog management.
-
10
Upload the ".htacess" file to the site's root directory. In many FTP editors, you simply drag the file into the root directory from the browser on the left-hand side of the screen.
-
11
Save your FTP settings and exit the program. Typically, you save the settings by clicking "File" and "Save." Your WordPress blog is now secure from unwanted visitors.
-
1
References
- Photo Credit Jupiterimages/Photos.com/Getty Images