Locked out of wp-admin: how to get back in

There are several routes back in depending on what is wrong. All of them need cPanel access, so start there.

You have forgotten the password

Use the Lost Password link first. If the site cannot send email – a common problem in itself – you can change the password directly in the database. In cPanel open phpMyAdmin, find the wp_users table, edit your row, and set user_pass using the MD5 function from the dropdown. WordPress will upgrade the hash to a modern one the first time you log in.

The email address is wrong or unreachable

Change user_email in the same table, then use Lost Password normally.

A plugin is blocking you

Security plugins lock people out with some enthusiasm. Rename the plugin's folder in wp-content/plugins to disable it, log in, and adjust its settings before renaming the folder back.

Your IP address has been blocked

If wp-admin, cPanel and webmail all stop working at once while the site is fine for other people, the block is at the server rather than in WordPress. See Why we block IP addresses, and how to get unblocked.

A redirect loop

Usually the Site Address and WordPress Address disagreeing with how the site is actually reached – www against non-www, or http against https. Set both explicitly in wp-config.php:

define( 'WP_HOME', 'https://www.example.com' );
define( 'WP_SITEURL', 'https://www.example.com' );

These override the database and will break the loop. Remove them once the settings are corrected.

Your role has been changed

If you can log in but see almost nothing, your account may no longer be an administrator. That is worth treating as a possible compromise – see My website has been hacked.

  • 0 Users Found This Useful
Was this answer helpful?

Related Articles

Why WP-Cron is disabled on our servers, and what replaces it

WordPress has its own scheduling system, WP-Cron, which runs scheduled tasks – publishing...

Object caching, and why Redis is not available here

WordPress can store the results of database queries in memory so that repeated requests do not...

Moving an existing WordPress site to us

A move goes wrong in predictable ways. Doing it in this order avoids all of them. 1. Set the...

The white screen of death: how to diagnose it

A completely blank page means PHP stopped part-way through and had nothing to show. The page...

Updating WordPress, plugins and themes without breaking the site

Most broken WordPress sites we see were working perfectly until an update ran. The updates are...