fbpx

Fixing WordPress Login Errors With cPanel

One of the most common WordPress hosting support requests is “Help, I can’t log in!” Being locked out of WordPress is unsettling to say the least, but don’t worry because you’ve come to the right place.

There are several reasons why you might be locked out of WordPress, and they are simple to resolve with cPanel and WHM. This article examines four of the most common login issues and demonstrates how to resolve them. They are as follows:

  • Logging in after forgetting your password.
  • Getting rid of the WordPress white screen of death.
  • Resolving a database error that prevents you from logging in.
  • Regaining administrative rights after your user has lost them.

Fixing a Lost or Forgotten WordPress Password

You’ve forgotten your WordPress password, so you can’t log in. In most cases, the built-in password reset tool suffices. If you can’t access the email account to which WordPress sends the reset link, you’ll have to dig into the MySQL database.

Fortunately, in cPanel, this is simple. To begin, launch phpMyAdmin, which can be found in the Databases section of the cPanel main page.

Locate your site’s database in the left-hand sidebar. It should look like yourusername_wp, but it may differ depending on how your site is set up.

When you click the plus sign (+), you’ll see a list of tables.

Click on the wp users table, which stores usernames and passwords.

Locate your username in the user login column and click Edit at the top of the row. The hashed password is displayed in the column next to your user’s login name, but you should not attempt to change it on this screen.

Locate the user pass row on the following screen and enter a new password in the value column. Select MD5 from the dropdown menu in the function column. Plaintext passwords are not stored by WordPress. It applies a hashing algorithm to the password and saves the hash value. We must replicate that by using the MD5 function.

Finally, press the Go button, and PHPMyAdmin will save the password hash to the database. You can now access your site using the new password.

Fixing The WordPress White Screen of Death in cPanel

Giving your user a new password in cPanel is simple, but what if the login interface never loads? If you see a blank screen, you are experiencing the White Screen of Death.

There are several possible causes, but the most likely is that there are incompatible or poorly written plugins, so the first step is to disable all plugins.

How to Disable WordPress Plugins without Logging In

The solution is to rename the folder containing the plugin files. Because WordPress is unable to locate the plugins, they will not be loaded. From the Files section of the main page, launch the cPanel File Manager.

Navigate to the directory of your site, which is most likely in the root or a subdirectory of public html.

Navigate to the wp-content/plugins directory and select the plugins folder.

From the toolbar, select Rename. Select a name such as “quarantined plugins.”

Now attempt to log in. If you’re successful, rename the directory back to “plugins.” If WordPress continues to function normally, disable all plugins in the WordPress interface and re-enable them one at a time until the login error occurs again. You’ve identified the culprit at this point.

If this method fails, you might consider restoring your site from a backup taken prior to the incident.

Fixing Lost Administrator Privileges on WordPress

Another common issue is the loss of administrative privileges. You can access your site, but not the features that require administrator privileges. This can occur if another admin user disables your access. It is also a common malware tactic, so as soon as you regain access, run a malware scanner.

To restore your privileges, we’ll create a new user account with the appropriate permissions. You can follow the same steps whenever you need to create a user from outside WordPress’s interface. It is possible to grant additional privileges to an existing user, but this method is simpler.

Fill out the form’s Value field with the following information:

  • ID: A number that is higher than the current highest user number. If you don’t know the highest number, use something like 100,000, depending on how many users your site has. 
  • user_login: A unique username. You will use this to log in. Do not use the same username as any other account on the site.
  • user_pass: Enter a new password. Set the dropdown list in the function column to MD5. The second step is crucial; if you don’t set the function to MD5, you won’t be able to log in. 
  • user_nicename: Your name or nickname. 
  • user_email: your email address. 
  • user_url: your site’s URL. 
  • user_registered: Click on the calendar next to this field and select a date. 
  • user_status: Leave at 0. 
  • Display_name: the name WordPress should use in its interface.

When you’re done, the form should look something like this:

Take note of the ID, user login, and user pass values, as you will need them in the following step and to log in.

Click the Go button. To confirm, click Go again, and the new user is added to the database.

Next, we must grant the new user administrative privileges. Return to your database’s main page and click Insert next to the wp usermeta table.

The admin privilege information must be added to this database field and associated with the new WordPress user via the user id value.

  • Leave the umeta_id field blank.
  • Enter the user_id from the previous step.  
  • In the meta_key field, enter wp_capabilities.
  • In the meta_value field, enter a:1:{s:13:”administrator”;b:1;} 

On this and the following pages, click Go as before. That’s all! You can now log in with admin privileges using the information you added to the database. Remember to look into why your account lost admin privileges in the first place.

Leave a Reply