How to Restore Access to WordPress Administrator: Resetting Password via Database
July 14, 2025
Losing access to the WordPress administrator account can be a real headache. Sometimes, standard password recovery methods (via email) don’t work, especially if:
- You forgot both your login and password.
- The site’s mail sending function (
wp_mail
) is broken. - The WordPress admin panel is broken or unavailable.
- The only access left is to the database (via MySQL client, phpMyAdmin, WP-CLI, etc.).
In this article, we’ll walk through a reliable and secure way to find the WordPress administrator directly in the database and reset their password using SQL. We’ll follow DevSecOps best practices to avoid breaking serialized data and minimize risks.