Skip to content

How to restrict WordPress login to specific IPs

This involves adding the following code to the .htaccess file within the root of the WordPress installation directory and add each IP addresses to a new line and IP subnet in the CIDR format.

The below code is displayed as an image due to WordPress limitation.

<files wp-login.php>
 order deny,allow
 Deny from all

# Whitelist IP address
allow IP.IP.IP.IP
</files>
comments powered by Disqus