Home › Knowledgebase › KB-1682

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.

Quick Tip: Need immediate assistance? 💻 Open a Ticket

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

  1. Identify the public IP address of the user who needs access.
  2. Log in to your WordPress dashboard or hosting control panel.
  3. Navigate to your security plugin or Web Application Firewall (WAF) settings.
  4. Add the trusted IP address to the allowlist specifically for /wp-admin and /wp-login.php.
  5. Save the changes and clear any server-side or WAF caching.
  6. 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).

If the user has a dynamic IP address from their home internet provider, the address may change periodically. This can cause repeated lockouts. For reliable access, we recommend using a static IP address or connecting via a VPN with a fixed endpoint.

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

  1. Log in to your WordPress admin area.
  2. In the left-hand menu, go to Wordfence > Firewall.
  3. Select the IP Allowlist tab.
  4. Enter the public IP address you copied earlier.
  5. Specify that this rule applies to /wp-admin and /wp-login.php.
  6. Click Save Changes.

Using Solid Security (formerly iThemes Security)

  1. Log in to your WordPress admin area.
  2. In the left-hand menu, go to Security > Settings.
  3. Navigate to the IP Allowlist section.
  4. Enter the trusted IP address.
  5. Apply the rule specifically to the admin login area.
  6. Click Save Settings.

Using a Web Application Firewall (WAF) or Hosting Control Panel

  1. Log in to your hosting control panel or WAF dashboard.
  2. Navigate to the Firewall, WAF, or Security Rules section.
  3. Locate your existing country-blocking rule.
  4. Add an exception rule to allow traffic from the specific IP address to /wp-admin and /wp-login.php.
  5. Ensure the exception rule is placed above the general country-block rule in the priority list.
  6. Click Apply or Save.
After saving your firewall changes, clear any server-side caching or WAF caching to ensure the new allowlist rules take effect immediately.

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

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.

  1. Connect to your server using an FTP client or File Manager.
  2. Navigate to the folder containing your security plugin (usually /wp-content/plugins/).
  3. Rename the plugin folder to temporarily disable it (for example, rename wordfence to wordfence-disabled).
  4. Log in to your WordPress admin area and reconfigure your firewall rules.
  5. Rename the folder back to its original name once you have regained access.
Be careful when editing firewall rules directly. Incorrectly configured rules can block all traffic to your website, not just the admin area. If you are unsure, it is safer to request assistance.

If you require assistance configuring these rules, please Open a Ticket and our Brisbane team will help you.

Still Having Issues?

Need more help? If the issue persists after trying these steps, please open a support ticket and our team will assist you.

💻 Open a Ticket