adsense

How to Block Certain IP Addresses From Viewing My Wordpress Blog





WordPress Self-Hosting Tool Users
1. Confirm which IP address or addresses you want to ban. Consider that although you may be able to ban specific IP addresses from viewing your blog, a user can still use other computers to view your blog. Similarly, while blocking IP addresses reduces spam and unwanted visitors, it also can increase the chance of blocking legitimate users and visitors to your blog.
2. Locate your .htaccess file. The .htaccess file should be saved in the folder where your WordPress installation is located. If you do not have an .htaccess file, you can create one. If you have shell or SSH access to the server, open shell or SSH session and type in the 'touch .htaccess' command to create the file.The .htaccess file may not be visible if you are using certain FTP clients. If using an FTP client, you may need to change the preferences of the FTP tool to show all files. You can also create a .htaccess file by using a text editor on your computer (for example, Notepad on Windows-based computers) and saving the file as '1.htaccess.' You can then upload the file to the root of your WordPress folder and rename it to '.htaccess.'

3. Open and review the .htaccess file. Below is an example of an .htaccess file:Order allow,deny
Deny from 123.123.123.123
Deny from 134.134.134.*
Deny from 156.156.*.*
Allow from all
4. Type in the IP addresses you wish to ban. To enter the new IP addresses, type 'Deny from' followed by the IP address. For example:Deny from 123.123.123.123You also can add simpler IP addresses by dropping one or more of the IP numbers, for example:Deny from 156.156.*.*orDeny from 134.134.134.*By using simpler IP addresses, you can block any IP address that starts with the first numbers, such as 156.156, which saves you some time from typing individual numbers.
5. Close the file and save any changes. Before blocking an IP address, consider testing the changes by asking someone you know to provide you with his IP address. Inform your friend about what you are doing and follow the steps for changing the .htaccess file using his IP address. Have him try to access the blog. Once you know the access restriction works, remove your friend's IP address and revise the .htaccess files with the IP address or addresses you wish to block.
WordPress.com Users
6. Confirm which IP addresses you wish to limit access to your site. At the time of publication, WordPress does not block IP addresses since it may inadvertently prevent other people from using WordPress.com. However, you can limit certain users from commenting on your blog.
7. Log in to your WordPress.com blog account and click on 'Settings' on the navigation sidebar on your blog's dashboard. Select 'Discussion' under the settings menu options.
8. Enter the IP address or IP addresses you wish to restrict in the Comment Blacklist box. You should enter one IP address per line in the box. When a user with a matching IP address attempts to comment on your blog, the comment is automatically marked as spam and held for moderation. You then can delete the comment, which will not appear on your blog unless you approve it.

Comments

0 Responses to "How to Block Certain IP Addresses From Viewing My Wordpress Blog"

Post a Comment

Popular Posts

About