Sharing is caring!
Have you ever run into a situation where you could not access the WordPress Dashboard? Well, there are several reasons for this to happen, which I will mention. The primary focus of this article is dealing with an update to WordPress. After the update, the database version does not match with the WordPress version. If you would like to scroll to that section below it is a bold line called, “Error After A Major WordPress Update“.
This article is one that consists of a little work inside the WordPress Database. The procedure is pretty simple to follow. I will guide you along the way with pictures for you to reference.
Some of the topics discussed require knowledge and access to WordPress files. You may need access file management platform or FTP, as well as access to PHPMyAdmin. Managed hosting sites do not allow for this form of file access. If you are on a managed hosting account, please contact your provider.
Restore from a backup
If you need quick recovery and don’t mind losing some information since your last backup, restore to a previous save point.
A plugin may be the culprit. Open your FTP Client or connect using your file management. Locate the directory where your WordPress site is. Depending on the provider, it could be the “public_html”. Find the folder called wp-content and open it. Inside you will see another folder called, “plugins”. Right-click the plugins folder and rename it to plugins123 or anything you like.
Now test your site. If you have access to the dashboard, you know that one of the plugins is the issue.
You may have lost or forgotten your password, denying access to the site. You may correct this in PHPMyAdmin. Select “wp_users”, then edit the user that forgot the password. Select MD5 Encryption and type the new password.
Too many tries can’t access the site
Using FTP or File Management to access the site files. Navigate to wp-contents > plugins > locate your security plugin and change the name. Changing the file name will disable the site lock option on your site.
Inside the wp-content folder right-click the plugins folder and rename it by adding something to the end of it.
The .htaccess file
If you are not sure about reading code you may still see if the .htaccess file is the issue. The file location is in the root directory where your WordPress files are. Be sure to make a copy of the .htaccess file and save it on your computer. Now you may delete it from the list of files.
If that solved the issue, then go into the backend and change your permalink structure. By changing the permalinks WordPress should recreate the .htaccess file. Please make a note here that if you do not read code, or are not certain, you may have been hacked. Be sure to run a full security scan of your site. If you are not familiar with WordPress and directory structure, have a security expert look at your files and folders.
Example of an .htaccess file
Update database tables
Open PHPMyAdmin and select all tables. At the bottom select update tables. That may solve your issue. Try to access wp-admin.
There are additional reasons you may have lost access to the dashboard. I covered several of the primary reasons. However, now I want to cover the one that took me a little research to figure out.
Error After a Major WordPress Update
I found that I could log in without an issue, but the dashboard would not open. Instead, I got a message saying that I do not have access to the site. There was a directory listing of /wp-admin/upgrade.php. My initial investigation brought forth no results other than what I was already familiar with. The address bar caught my attention. It read: /wp-admin/upgrade.php?step=1&backto=%2Fwp-admin%2F.
It ends up that this error is from a failed WordPress Update to version 5.5. The WordPress files were fine, but the database version did not match with what WordPress said it should be. So how do you go about finding this information out? Let me tell you that the first thing you need to do is visit the WordPress Version Codex.
The codex lists each WordPress version, the release date, and the database version. Now we need to verify everything is correct.
Open the version.php file for verification. wp-includes > version.php. Within the code, you are looking for two things.
1) $wp_version = ‘5.5’; – This is the current version of WordPress
2) $wp_db_version = 48748; – This is the current Database Version
Open the codex to verify the above numbers are correct. The update failed to update the database version number. If the numbers are incorrect, then you may need to reinstall from a backup.
Next open PHPMyAdmin to access the database. from the sections on the left pane select “wp_options”. Now on the page search for “db_version”. Mine was on the second page of the content.
Note: the image below shows the correct number as I have already made the change.
Now select “Edit” on the entry for db_version. A new page with options for editing will open. Overwrite the current number with the correct one. Ensure you enter the version number that corresponds to your WordPress Version. Select the “Go” button to update the database.
Now you should have a functional WordPress website with access to the dashboard. Make sure to change the names of folders and replace files you may have removed.
I hope this has been a big help to anyone online searching for a way to repair their WordPress website.
Sharing is caring!