How to Allow Your IP Address Access to Wordpress - htaccess

If you would like to limit access to your Wordpress Login script to only specified IP Addresses, you can use the .htaccess file in your root wordpress folder to specify the IP addresses you want to allow. 

You would edit the .htaccess file using the cPanel File Manager or using an editor on your computer and then upload it to the server. 

You should include the following content in top top most area of the .htaccess file. You would replace the xxx.xxx.xxx.xxx with your IP address. If you are unsure of your own IP address then you could look it up by browsing to the following: http://cloud.webpal.net/information/getip.php 

 

<Files ~ "^wp-login.php">
order deny,allow
deny from all

allow from 24.224.141.162

satisfy all
</Files>
ErrorDocument 403 "Not acceptable"

 

To give you an example of a complete typical Wordpress .htaccess file please see the following: 

 

<Files ~ "^wp-login.php">
order deny,allow
deny from all

allow from 24.224.141.162

satisfy all
</Files>
ErrorDocument 403 "Not acceptable"

RewriteEngine On
RewriteRule ^index\.php$ - [L]

# add a trailing slash to /wp-admin
RewriteRule ^([_0-9a-zA-Z-]+/)?wp-admin$ $1wp-admin/ [R=301,L]

RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ - [L]
RewriteRule ^([_0-9a-zA-Z-]+/)?(wp-(content|admin|includes).*) $2 [L]
RewriteRule ^([_0-9a-zA-Z-]+/)?(.*\.php)$ $2 [L]
RewriteRule . index.php [L]


 
Was this answer helpful?

Related Articles

Why does Google say my site contains malware?

(WORK IN PROGRESS!)So you've gotten a few calls, emails, drop-in visits with some frantic current...

How do I move Wordpress from one location/domain to another?

Step 1:  Copy the entire contents of the old domain folder, which includes your entire WordPress...

Activating WordFence Extended Protection

WordFence Auto Sense Firewall (images to come!) An issue has been identified with a Wordpress...

How To Change Your WordPress Login URL

How To Change Your WordPress Login URL The short answer is to install, activate, and configure...

How to Prevent Brute Force Attacks on Your Wordpress Install

Unlike hacks that focus on vulnerabilities in software, a Brute Force Attack aims at being the...

Powered by WHMCompleteSolution