WordPress Admin Lockout Country Blocking
Summary
This guide helps you troubleshoot and resolve: WordPress Admin Lockout Country Blocking. Follow the steps below to fix the issue.
Common Causes
Many small businesses in Brisbane and the Gold Coast use country-blocking rules on their WordPress websites to reduce spam and automated bot attacks. While this is an effective security measure, it can unintentionally prevent staff, accountants, or contractors from accessing the WordPress admin area when they are travelling or working from a remote location. This guide explains how to create IP-based exceptions for /wp-admin and /wp-login.php while keeping your global country-blocking rules active.
Quick Fix Steps
- Identify the public IP address of the user who needs access.
- Log in to your WordPress dashboard or hosting control panel.
- Navigate to your security plugin or Web Application Firewall (WAF) settings.
- Add the trusted IP address to the allowlist specifically for
/wp-adminand/wp-login.php. - Save the changes and clear any server-side or WAF caching.
- Test the login page.
Detailed Instructions
Step 1: Find your public IP address
Before configuring your firewall, you need to know the public IP address of the device or office network that requires access. If you do not know your public IP address, open a web browser on the device that will access the admin area and visit an IP lookup service such as icanhazip.com or ipinfo.io. Copy the IPv4 address displayed on the screen (for example, 203.0.113.45).
Step 2: Configure your security plugin or WAF
Depending on which tool you are using, the exact menu names may vary. Follow the specific paths below for common WordPress security plugins.
Using Wordfence
- Log in to your WordPress admin area.
- In the left-hand menu, go to Wordfence > Firewall.
- Select the IP Allowlist tab.
- Enter the public IP address you copied earlier.
- Specify that this rule applies to
/wp-adminand/wp-login.php. - Click Save Changes.
Using Solid Security (formerly iThemes Security)
- Log in to your WordPress admin area.
- In the left-hand menu, go to Security > Settings.
- Navigate to the IP Allowlist section.
- Enter the trusted IP address.
- Apply the rule specifically to the admin login area.
- Click Save Settings.
Using a Web Application Firewall (WAF) or Hosting Control Panel
- Log in to your hosting control panel or WAF dashboard.
- Navigate to the Firewall, WAF, or Security Rules section.
- Locate your existing country-blocking rule.
- Add an exception rule to allow traffic from the specific IP address to
/wp-adminand/wp-login.php. - Ensure the exception rule is placed above the general country-block rule in the priority list.
- Click Apply or Save.
Alternative Security Measure: Two-Factor Authentication
Instead of relying solely on IP allowlisting, we recommend enabling two-factor authentication (2FA) for all users with access to the WordPress admin area. 2FA provides an additional layer of security that protects your site even if a password is compromised, and it reduces the need for complex IP-based exceptions for travelling staff.
Troubleshooting
I still cannot access the admin area
- Double-check that you entered the correct public IP address and not a private local IP (such as
192.168.x.x). - Clear your browser cache and cookies, then try again.
- Clear any server-side or WAF caching that may be serving an old version of the firewall rules.
- Check if another security plugin is overlapping and blocking the request.
- Verify that your IP address has not changed if you are on a home internet connection with a dynamic IP.
- Check your server or firewall logs to see if the request is being blocked and why.
I am locked out of my own website
If you have accidentally blocked your own IP address and cannot log in to WordPress, you will need to access your site via FTP or your hosting control panel's File Manager.
- Connect to your server using an FTP client or File Manager.
- Navigate to the folder containing your security plugin (usually
/wp-content/plugins/). - Rename the plugin folder to temporarily disable it (for example, rename
wordfencetowordfence-disabled). - Log in to your WordPress admin area and reconfigure your firewall rules.
- Rename the folder back to its original name once you have regained access.
If you require assistance configuring these rules, please Open a Ticket and our Brisbane team will help you.
Still Having Issues?
💻 Open a Ticket