Restrict WordPress admin access by IP address

Do you want to increase the security of your WordPress website? Restricting WordPress admin access by IP address is one of the most recommended solutions to keep your website safe. You will learn ways to Restrict WordPress admin access by IP which is helpful o protect the information and access to the managed pages. It is not necessary a lock or external applications, but the correct use of IP addresses that allow you to retain absolute control.

And with the inclusion of the precise codes, it is possible to apply actions for the WordPress login or limit functions for external users that you do not want to enter the administration of the information.

Learn more about how to manage WordPress and how to protect it correctly.

What is WordPress?

WordPress is one of the most important platforms for content management and has been available since 2003.

Its format allows the creation of websites, blogs and posts that can be published on the Internet and shared in a simple, effective and professional style thanks to all the tools available to its users makes it easy to restrict WordPress admin access by IP.

With a simple entry and management possible for all types of members, WordPress is the ideal option to start making your business known on Internet for free.

But even so, it has different advanced options that you can apply or consult a specialist, so we show you how to restrict WordPress admin access by ip address and more applications.

IP Configuration

We share the options and codes that allow you to perform specific actions with the use of the IP of your page according to the situation and spaces you want to restrict to other users.

Block an IP address from accessing WP Admin

In order not to block all IP addresses you can exclude a specific IP address from accessing your website from that location.

To do this you can do it from the “.htaccess.” file in the “wp-admin” directory.

You will have to enter the following code in the file:

<Files wp-login.php>

Order Deny,Allow

Deny from all

Allow from xx.xx.xx.xx.xx


In the “Allow from” section you must add your IP address.

To exclude other addresses just add one more line with the data and save the changes in the .htaccess file.

Other functions

Restrict WordPress admin access by IP address to the wp-login.php file

With the access to the .htaccess file. it is possible to restrict access to the WordPress wp-login file with the initial steps to the previous point, although with a new formula that will have to be appended to restrict WordPress admin access by IP.:

<Files wp-login.php>

order deny,allow

Deny from all

# allow access from my IP address

allow from xxx.xx.xx.xx.xx

# allow access from my IP address

allow from


restrict WordPress admin access by IP.
restrict WordPress admin access by IP.

Allow access to WordPress admin from specific IP address

On the other hand, to allow access to the WordPress admin, you must go to the .htaccess. file to append the new address that will be allowed.

This option is very useful to ensure access from a specific IP address, usually your own.

order deny, allow

allow from xxx.xx.xx.xx.xx

deny from all

To add new IP addresses, you must append a new line with the specific data and save the changes.

Read Next

Similar Articles




Most Popular