Resolving the 403 Forbidden and 127.0.0.1 Redirect Lockout in AIOS Security
Content
One of the most common and stressful issues users report with the All-In-One Security (AIOS) plugin is being suddenly locked out of their WordPress admin area. This typically manifests as an HTTP 403 Forbidden error or a redirect to 127.0.0.1 when trying to access wp-admin or wp-login.php.
This guide will explain why this happens and provide the most effective methods to regain access to your site.
Why Does This Lockout Happen?
The AIOS plugin is designed to harden your WordPress security. The lockout occurs when a powerful security feature is enabled but misconfigured or conflicts with another setting. The most common culprits are:
- Login Whitelist: If this is enabled and your current IP address is not on the whitelist, you will be blocked with a 403 error.
- Cookie-Based Brute Force Prevention: This feature adds a secret word to your login URL. If you forget the secret word or try to access the standard login page, you are redirected to 127.0.0.1.
- Renamed Login Page: Forgetting the custom slug you set for your login page will prevent you from accessing it.
- Firewall Rules: Certain advanced rules, like the Advanced Character Filter or 5G/6G Blacklist, can sometimes block legitimate traffic, especially on sites with non-ASCII characters in URLs (e.g., Arabic, Cyrillic).
How to Regain Access to Your WordPress Site
Follow these solutions in order. The first method is the quickest and most common fix.
Solution 1: Use a Configuration Constant (Quick Fix)
The fastest way to disable the security feature causing the lockout is to add a special constant to your site's wp-config.php file. You can do this via your hosting control panel's File Manager or FTP.
- Locate and edit the
wp-config.phpfile in your WordPress root directory. - Add one of the following lines of code above the line that says
/* That's all, stop editing! Happy publishing. */.- For 403 Errors / IP Whitelist Issues:
define( 'AIOS_DISABLE_LOGIN_WHITELIST', true ); - For 127.0.0.1 Redirects:
define( 'AIOS_DISABLE_COOKIE_BRUTE_FORCE_PREVENTION', true ); - To Disable the Entire Firewall:
define( 'AIOS_NO_FIREWALL', true );
- For 403 Errors / IP Whitelist Issues:
- Save the file and try to access your login page again. You should now be able to log in.
- Once logged in, remember to remove the constant from
wp-config.phpand properly reconfigure the problematic AIOS setting to avoid leaving a security hole.
Solution 2: Rename the Plugin Folder (Nuclear Option)
If the constant method doesn't work, you can force the plugin to deactivate.
- Connect to your site via FTP or your hosting File Manager.
- Navigate to the
/wp-content/plugins/directory. - Find the folder named
all-in-one-wp-security-and-firewall. - Rename this folder to something else, like
all-in-one-wp-security-and-firewall-off. - This will deactivate the plugin. You should now be able to access
yoursite.com/wp-admin. - After logging in, rename the folder back to its original name to reactivate the plugin. You will need to reconfigure its settings.
Solution 3: Fully Reset the Plugin (For Forgotten Settings)
If you've forgotten a renamed login slug or want to wipe all AIOS settings, you need to remove its data from your database and server after deactivating it (using Solution 2).
- Database: Using a tool like phpMyAdmin, run this SQL query to delete AIOS options:
SELECT * FROM wp_options WHERE option_name LIKE '%aio%'
(Note: Replacewp_with your database prefix if it's different). Carefully delete the identified rows. - .htaccess File: Edit your root
.htaccessfile. Find and remove all lines between and including# BEGIN All In One WP Securityand# END All In One WP Security. - Other Files: Check for and delete the file
/wp-content/mu-plugins/aios-firewall-loader.phpif it exists.
Conclusion
Being locked out of your site can be alarming, but it is almost always reversible. The key is to understand that these security features are working as intended—they are just working too well for your specific configuration. The wp-config.php constants provide the safest and fastest way to regain access without losing your plugin settings. Always ensure your IP is correctly whitelisted and you have recorded any custom login URLs or secret words before enabling these powerful security features.
Related Support Threads Support
-
Site is locked out exept for logged in usershttps://wordpress.org/support/topic/site-is-locked-out-exept-for-logged-in-users/
-
Unable to log in with Google Authenticatorhttps://wordpress.org/support/topic/very-big-problem-after-not-renewing-the-pro-license/
-
my wp login page does not workhttps://wordpress.org/support/topic/my-wp-login-page-does-not-work/
-
Issue with Arabic Languagehttps://wordpress.org/support/topic/issue-with-arabic-language/
-
Site has become slowhttps://wordpress.org/support/topic/site-has-become-slow/
-
Help I am behind a vpn nowhttps://wordpress.org/support/topic/help-i-am-behind-a-vpn-now/
-
Locked out of admin!https://wordpress.org/support/topic/locked-out-of-admin-27/
-
Problemas con el Loginhttps://wordpress.org/support/topic/problemas-con-el-login-2/
-
Custom login pagehttps://wordpress.org/support/topic/custom-login-page-33/
-
Not able to download the backup filehttps://wordpress.org/support/topic/not-able-to-download-the-backup-file/
-
Updated plugin now get 404 when try to sign inhttps://wordpress.org/support/topic/updated-plugin-now-get-404-when-try-to-sign-in/
-
can’t access dashboard, always jumps to frontpagehttps://wordpress.org/support/topic/cant-access-dashboard-always-jumps-to-frontpage/
-
Restore the default settings of this pluginhttps://wordpress.org/support/topic/restore-the-default-settings-of-this-plugin/
-
All in one security locked me out and will not let me reset to default settingshttps://wordpress.org/support/topic/all-in-one-security-locked-me-out-and-will-not-let-me-reset-to-default-settings/
-
http desktop idhttps://wordpress.org/support/topic/http-desktop-id/
-
critical error with custom login url and 2FA through Pluginhttps://wordpress.org/support/topic/critical-error-with-custom-login-url-and-2fa-through-plugin/
-
Custom Login Page no longer working? Locked out.https://wordpress.org/support/topic/custom-login-page-no-longer-working/
-
Not available access dashboardhttps://wordpress.org/support/topic/not-available-access-dashboard/
-
Denied Access to Sitehttps://wordpress.org/support/topic/denied-access-to-site/
-
Access problemhttps://wordpress.org/support/topic/access-problem-8/
-
Siteground autologin not workhttps://wordpress.org/support/topic/siteground-autologin-not-work/
-
No access after SSL activationhttps://wordpress.org/support/topic/no-access-after-ssl-activation/
-
Unauthorizedhttps://wordpress.org/support/topic/unauthorized-7/
-
I can´t login in the websitehttps://wordpress.org/support/topic/i-cant-login-in-the-website/
-
Moved WordPress site files to a different directory, cannot loginhttps://wordpress.org/support/topic/moved-wordpress-site-files-to-a-different-directory-cannot-login/
-
wp invalid login credentialshttps://wordpress.org/support/topic/wp-invalid-login-credentials/
-
Unable login with secret slug – redirect to wp-adminhttps://wordpress.org/support/topic/unable-login-with-secret-slug-redirect-to-wp-admin/
-
All-in-One disables login URLhttps://wordpress.org/support/topic/all-in-one-disables-login-url/
-
Problem with the login lockhttps://wordpress.org/support/topic/problem-with-the-login-lock/
-
HTTP ERROR 403 PLUGIN ALL IN ONE WP SECURITYhttps://wordpress.org/support/topic/http-error-403-plugin-all-in-one-wp-security-2/
-
Cannot reach WP Login anymorehttps://wordpress.org/support/topic/cannot-reach-wp-login-anymore/
-
Want to be help with youhttps://wordpress.org/support/topic/want-to-be-help-with-you/
-
Can No Longer Login From cPanelhttps://wordpress.org/support/topic/can-no-longer-login-from-cpanel/
-
Images not loading for logged-out users, 403 errorhttps://wordpress.org/support/topic/images-not-loading-for-logged-out-users-403-error/
-
Wrong reCaptcha Key/Locked Outhttps://wordpress.org/support/topic/wrong-recaptcha-key-locked-out/
-
Can’t access wp-admin – 127.0.0.1 redirecthttps://wordpress.org/support/topic/cant-access-wp-admin-127-0-0-1-redirect/
-
Language switcher on the login screen does not workhttps://wordpress.org/support/topic/language-switcher-on-the-login-screen-does-not-work/
-
I can’t login to the admin panelhttps://wordpress.org/support/topic/i-cant-login-to-the-admin-panel-2/
-
Locked out of site by recaptcha errorhttps://wordpress.org/support/topic/locked-out-of-site-by-recaptcha-error/
-
I lost access to browse my webistehttps://wordpress.org/support/topic/i-lost-access-to-browse-my-webiste/
-
message 127.0.0.0.1https://wordpress.org/support/topic/message-127-0-0-0-1/
-
IP 127.0.0.1https://wordpress.org/support/topic/ip-127-0-0-1/
-
My hosting company migrated my site to a new server and I am locked out!https://wordpress.org/support/topic/my-hosting-company-migrated-my-site-to-a-new-server-and-i-am-locked-out/
-
forgotton custom URL linkhttps://wordpress.org/support/topic/forgotton-custom-url-link/
-
Does not link pages of a multilingual sitehttps://wordpress.org/support/topic/does-not-link-pages-of-a-multilingual-site/
-
Problem with login page namehttps://wordpress.org/support/topic/problem-with-login-page-name/
-
Login goes to 127.0.0.1https://wordpress.org/support/topic/login-goes-to-127-0-0-1/
-
Can’t Access Login Pagehttps://wordpress.org/support/topic/cant-access-login-page-15/
-
WP-admin Page HTTP ERROR 403https://wordpress.org/support/topic/wp-admin-page-http-error-403/
-
Thumbnails wont open when clicked onhttps://wordpress.org/support/topic/thumbnails-wont-open-when-clicked-on/
-
SiteGround auto-login does not work when plugin activatedhttps://wordpress.org/support/topic/siteground-auto-login-does-not-work-when-plugin-activated/
-
Page /wp-login.php loads fullhttps://wordpress.org/support/topic/page-wp-login-php-loads-full/
-
Can not loginhttps://wordpress.org/support/topic/can-not-login-20/
-
Not having access to the WordPress dashboardhttps://wordpress.org/support/topic/not-having-access-to-the-wordpress-dashboard/
-
After disabling the plugin I can’t get into the admin panelhttps://wordpress.org/support/topic/after-disabling-the-plugin-i-cant-get-into-the-admin-panel/
-
All-In-One Security option to access the user areahttps://wordpress.org/support/topic/all-in-one-security-option-to-access-the-user-area/
-
Locked out in HTTP authentication loophttps://wordpress.org/support/topic/locked-out-in-http-authentication-loop/
-
Can’t loginhttps://wordpress.org/support/topic/cant-login-290/
-
wp security plugin is giving error when activatedhttps://wordpress.org/support/topic/wp-security-plugin-is-giving-error-when-activated/
-
login page & whole site unaccessiblehttps://wordpress.org/support/topic/login-page-whole-site-unaccessible/
-
Firewall error: Uncaught Exception: Unable to determine the current context.https://wordpress.org/support/topic/firewall-error-uncaught-exception-unable-to-determine-the-current-context/
-
“Not Available” issue because the pluginhttps://wordpress.org/support/topic/not-available-issue-because-the-plugin/
-
Cant Access My Dashboardhttps://wordpress.org/support/topic/cant-access-my-dashboard-36/
-
How to restore the login to the administrative panel of the site.https://wordpress.org/support/topic/how-to-restore-the-login-to-the-administrative-panel-of-the-site/
-
Issues with upgrade from PHP 7.4 to 8.2https://wordpress.org/support/topic/issues-with-upgrade-from-php-7-4-to-8-2/