How to retrieve or create a new WordPress admin user in the event of a disaster

How to retrieve or create a new WordPress admin user in the event of a disaster

If you need to recover an administrator user in WordPress or create a new one in case of an emergency, you can do so by following these steps:

 

Access your WordPress site database. You can do this through phpMyAdmin from the cdmon control panel.

 

In your WordPress database, open the "wp_users" table and locate the record of the user you want to recover, or create a new record if necessary. To create a new one, click on “Insert” in the main database menu once you are inside the users table. In the image below, it is highlighted in green:

 

 

Modify the "user_login", "user_email", and "user_pass" fields as needed. If you are creating a new user or recovering access, make sure to set a secure password using a hash function such as md5.

 

Ensure that the "user_status" field has a value of 0 for the user you have just created.

 


Finally, in the "wp_usermeta" table, locate the record associated with the user you have just created or modified and click on “Edit”.

 

Modify the "meta_value" field so that it contains the value: a:1:{s:13:"administrator";s:1:"1";} to grant the user administrator permissions.

 


Save the changes and close the database.

 

After completing these steps, log in to your WordPress site with the recovered or newly created administrator user. If your site is in a critical state, these steps will allow you to regain access and take control in order to resolve the issue. However, we strongly recommend making a backup of your database before performing any modifications.

    • Related Articles

    • How to create users from the Wordpress administrator

      On different occasions, we need to create new users to manage our WordPress due to the fact that we may need to grant access to a third party or because the WordPress site is managed by more than one person. In the following guide, we will show how ...
    • How to change the WordPress administrator password from wp-admin

      In this guide, we will show how to change your WordPress user password from /wp-admin, that is, from your WordPress admin panel. Your administration folder does not necessarily have to be called /wp-admin, but by default this is the name of the ...
    • Wordpress Error: It was not possible to create the directory

      It is possible that if changes have been made to the WordPress configuration, you may at some point receive a message like this when trying to install a new theme or update a plugin: This means that WordPress is not connecting to the directory ...
    • Wordpress structure and files

      WordPress is the most well-known and widely used CMS in the world. It allows you to develop websites without having extensive knowledge of programming or web development. Hence its great success. After all, WordPress is an interface that allows you ...
    • We update your Wordpress

      Do you want to update your WordPress and don’t know how? Are you not sure whether your WordPress needs to be updated? At cdmon we offer an update service that can help you update your WordPress to the latest version. What actions will the cdmon team ...