Skip to content
ThemesIonic — home
Troubleshooting

When wp-admin Stops Working

"wp-admin is not working" covers five unrelated faults: a redirect loop, a 404, a critical error, a permissions message and an unstyled dashboard. Each one has a different first check.

Updated 6 min read intermediate

Quick fix: work out which of five faults you have before you touch anything. A loop back to wp-login.php, a 404, a critical error, "Sorry, you are not allowed to access this page." and an unstyled dashboard each start with a different check.

Open /wp-admin/ in a private window and read the address bar and the page.

Symptom → first check → cause → fix

What you see First check Usual cause Fix
Back on wp-login.php?redirect_to=…&reauth=1 after every login Does the address in the browser match the WordPress Address exactly (host, www, protocol, path)? Auth cookie set for a different host or path, so it never reaches /wp-admin/ Correct siteurl/home, then clear the domain's cookies
Browser reports too many redirects, page never renders Is the site behind a proxy, load balancer or CDN that terminates HTTPS? FORCE_SSL_ADMIN is on but PHP thinks the request is plain HTTP Pass HTTPS through to PHP (snippet below)
404 on /wp-admin/ Does /wp-admin/index.php load? Server not using index.php as the directory index, or siteurl points to a path where core is not Fix the vhost index rule or the stored URL
"There has been a critical error on this website." Admin email inbox, then the PHP error log Fatal error in a plugin or theme Recovery mode link, or disable the plugin by file
"Sorry, you are not allowed to access this page." Does the account still have a role? Missing capabilities, often a table prefix mismatch Restore the role or fix the prefix
Dashboard loads as plain unstyled HTML Browser console: are load-styles.php / load-scripts.php blocked or failing? Wrong host/protocol in siteurl, or a rule blocking those files Correct the URL; test with CONCATENATE_SCRIPTS

Loop back to the login page

When a request reaches wp-admin without a valid cookie, auth_redirect() sends you to the login URL and adds reauth=1. The login page then clears the old auth cookies. If you log in successfully and still land back on reauth=1, the cookie WordPress set is not reaching /wp-admin/.

WordPress builds the auth cookie path from the WordPress Address: the admin cookie path is the siteurl path plus wp-admin. The cookie names also include a hash of siteurl. If you browse example.com while siteurl says www.example.com, or siteurl has a /wp path that the real install does not use, the browser has no matching cookie to send. Check what is actually stored. Be careful here: wp option get siteurl shows the WP_SITEURL constant if one is defined, so query the table when you need the raw value:

wp db query "SELECT option_name, option_value FROM wp_options WHERE option_name IN ('siteurl','home')"

Setting WP_HOME and WP_SITEURL explains how the two values differ and how to override them while you repair the database. If you see a cookie message instead of a silent loop, go to Cookies are blocked or not supported. The login redirect loop guide covers plugin and caching causes.

Too many redirects behind a proxy

If FORCE_SSL_ADMIN is not defined, WordPress turns it on whenever siteurl starts with https. wp-login.php and auth_redirect() then redirect any request that is_ssl() reports as non-HTTPS to the https:// version of the same URL. is_ssl() only looks at $_SERVER['HTTPS'] (on or 1) or port 443. A proxy that terminates TLS and forwards plain HTTP to PHP sets neither. Every request looks insecure, gets redirected to HTTPS, arrives as HTTP again, and the loop never ends.

If your proxy sends X-Forwarded-Proto, add this to wp-config.php above the "stop editing" line:

if ( isset( $_SERVER['HTTP_X_FORWARDED_PROTO'] ) && 'https' === $_SERVER['HTTP_X_FORWARDED_PROTO'] ) {
    $_SERVER['HTTPS'] = 'on';
}

Use it only if your own proxy sets that header. ERR_TOO_MANY_REDIRECTS covers the other redirect loops, such as CDN SSL modes and duplicate redirect rules.

404 on /wp-admin/

A 404 means WordPress never ran for that URL. On nginx, check that the server block has index index.php and passes .php files to PHP-FPM. On Apache, check DirectoryIndex. A broken .htaccess usually gives a 500 rather than a 404. Compare yours with the default WordPress .htaccess.

If core lives in a subdirectory, the admin is at /wp/wp-admin/, not /wp-admin/. With pretty permalinks enabled, WordPress catches 404s for /wp-admin, /admin and /dashboard and redirects them to the real admin URL. With plain permalinks it does not, so the 404 stays.

Critical error

WordPress error page: There has been a critical error on this website. Please check your site admin email inbox for instructions.
Reproduced on WordPress 7.1.5: an active plugin with a missing semicolon, display_errors off. This wording appears only in wp-admin and on the login page; visitors see the short version.

Since the fatal error handler arrived, a fatal error no longer gives a blank page. Visitors see "There has been a critical error on this website." In wp-admin and on the login page, the message adds "Please check your site admin email inbox for instructions." That email, titled "Your Site is Experiencing a Technical Issue", contains a recovery mode link. Recovery mode pauses the failing plugin or theme for your session only, so you can deactivate or update it. WordPress sends at most one of these emails per day, so if it never arrived, don't wait for another one.

Without the email, use the error log. The file path in the fatal line names the plugin. Then rename that plugin's folder, as described in disabling plugins without admin access. If the log shows "Allowed memory size … exhausted", the admin is running out of memory before the frontend does. See raising the memory limit. A bare 500 with no WordPress message comes from the server or .htaccess, not a plugin.

"Sorry, you are not allowed to access this page."

This is WordPress's own 403. On every admin screen, user_can_access_admin_page() checks the menu item's capability, and the Dashboard needs read. If even the Dashboard refuses you, the account has no role. After a migration, that is usually a table prefix mismatch: capabilities are stored under {prefix}capabilities in usermeta. The full walkthrough covers the fix.

Admin without CSS or with dead JavaScript

In the admin, WordPress bundles core styles and scripts into requests to wp-admin/load-styles.php and wp-admin/load-scripts.php. Their base URL is the WordPress Address. Open the browser console and look for those requests:

  • Blocked as mixed content or sent to another host: siteurl has the wrong protocol or domain. Correct it.
  • 403 from a firewall or 500: test by adding define( 'CONCATENATE_SCRIPTS', false ); to wp-config.php. Each file then loads separately. If the admin comes back, the bundling endpoints are being blocked or are breaking. Fix that rule, then remove the line. SCRIPT_DEBUG set to true also turns off bundling, and it loads unminified files too.

If the frontend is also unstyled, see CSS not loading.

Verify

  • A login lands on /wp-admin/ with no reauth=1 in the URL, in a private window and on a second browser.
  • siteurl and home in the database match the address bar, including protocol and www.
  • The console shows no failed load-styles.php or load-scripts.php requests.
  • Remove any temporary constants you added (CONCATENATE_SCRIPTS, override URLs) once the stored values are correct.

Frequently asked

The frontend needs no login cookie, no admin capability and no admin-only plugin code. wp-admin needs all three, plus the WordPress Address (siteurl) to match the address you are using, because admin links, cookie paths and the HTTPS requirement are all derived from it.
If the login URL ends in reauth=1, WordPress received your request for /wp-admin/ without a valid authentication cookie. Either the browser never sent it (wrong cookie path or host from a mismatched siteurl) or it was rejected. A page that never loads and shows a too-many-redirects error is a different fault: HTTPS detection behind a proxy.
The admin loads its CSS and JavaScript in bundles from wp-admin/load-styles.php and load-scripts.php, using the WordPress Address as the base URL. If that address has the wrong host or protocol, or a server rule blocks those two files, the dashboard renders as plain HTML. Adding CONCATENATE_SCRIPTS false to wp-config.php tells you which case it is.

Related guides