访问/wp-admin跳转至异常页面,如何恢复WordPress后台访问权限?
Hey there, let's break down what's likely causing this weird behavior and walk through steps to get back to your WordPress dashboard.
Possible Causes & Fixes
1. WP Super Cache is Accidentally Caching Admin Pages
Normally, plugins like WP Super Cache are configured to exclude admin pages from caching—but misconfigurations or glitches can break this. When that happens, you're seeing static cached content instead of the dynamic admin interface.
Fix:
- Access your site via FTP or your hosting control panel's file manager.
- Navigate to
wp-content/cacheand delete all files/folders inside it (this forces the plugin to rebuild fresh cache). - If you have command line access, run:
rm -rf wp-content/cache/*(double-check the path first!) - Try reloading
site.com/wp-adminafter clearing the cache.
2. Default Admin Entry Was Hidden (Security Measure)
Many developers use security plugins (like iThemes Security, Wordfence, or Hide My WP) to rename/hide the default wp-admin or wp-login.php paths to prevent brute-force attacks. Using the old path will land you on an error or cached garbage.
Fix:
- First, try accessing the core login page directly:
site.com/wp-login.php(most hiding plugins leave this intact, or redirect it to the custom login URL). - If that doesn't work, disable all plugins to bypass the hiding feature:
- Rename the
wp-content/pluginsfolder toplugins_disabledvia FTP/file manager. - This deactivates every plugin, including the one hiding your admin entry.
- Now try
site.com/wp-adminagain—you should see the normal login screen.
- Rename the
3. Corrupted .htaccess File (From WP Super Cache)
WP Super Cache adds rewrite rules to your .htaccess file to serve cached content. If these rules get corrupted, they might redirect admin requests to static cache files instead of the actual WordPress backend.
Fix:
- Back up your existing
.htaccessfile (copy it to your computer just in case). - Replace the contents of
.htaccesswith the default WordPress rewrite rules:
# BEGIN WordPress <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteRule ^index\.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] </IfModule> # END WordPress
- Save the file and reload
site.com/wp-admin.
4. Restricted Admin Access (Intentional or Accidental)
It's possible the original developer restricted access to the admin area—either via IP whitelisting, modified user permissions, or even deleting your admin account.
Fix:
- Check user permissions via database:
- Access your site's database via phpMyAdmin (your hosting control panel usually has this tool).
- Find the
wp_userstable (your prefix might be different if the developer changed it) and verify your account exists. - If you need to create a new admin account, run this SQL query (replace placeholders):
INSERT INTO wp_users (user_login, user_pass, user_nicename, user_email, user_registered, user_status, display_name) VALUES ('new_admin', MD5('your_secure_password'), 'New Admin', 'your_email@example.com', NOW(), 0, 'New Admin'); INSERT INTO wp_usermeta (umeta_id, user_id, meta_key, meta_value) VALUES (NULL, 483678, 'wp_capabilities', 'a:1:{s:13:"administrator";s:1:"1";}'); INSERT INTO wp_usermeta (umeta_id, user_id, meta_key, meta_value) VALUES (NULL, 483678, 'wp_user_level', '10'); - Check IP restrictions: If your hosting has a firewall or the developer used a plugin to whitelist IPs, make sure your current IP is allowed.
Recommended Troubleshooting Order
Start with the simplest fixes first to save time:
- Clear WP Super Cache
- Try
site.com/wp-login.php - Disable all plugins
- Reset
.htaccess - Verify user permissions/database
内容的提问来源于stack exchange,提问作者Jackie

