Don’t you hate when you run into a WordPress error? You felt like you were finally getting the hang of things and then WordPress tells you there is an error establishing a database connection or that they can’t retrieve your lost admin email and password. It can be really frustrating when you are trying to run your business online and you end up with a WordPress error.
The good news is that there is usually a pretty simple formula to follow for each of the most common errors that will likely fix the problem. Save this article for those times when a WordPress error pops up and use these fixes for the 5 most common errors.
Getting the White Screen of Death
One of the errors that sometimes happens on WordPress is the white screen of death in which your page has gone completely blank. There is no error message or explanation making it a challenge to fix the problem. The good news is that it usually happens for two reasons that can be fixed with some tweaking.
The first potential reason for the white screen of death is that you’ve reached your memory limit and you need to increase it. Extend the memory limit by opening the file “wp-config.php” and adding the line of code that says “define (‘WP_MEMORY_LIMIT’, ’64M’); within your main PHP tags.
The other reason could be that you have a poorly coded plugin or theme which means you need to disable your plugins and make your theme the default theme. That way if your active theme and plugins are the issue, it should resolve itself and you’ll know what the cause was. You can then add one plugin back in at a time, but if you find that the issue didn’t resolve, you’ll want to check the theme’s functions.php and remove extra spaces at the bottom of the file.
Establishing Database Connection Error
Sometimes the screen will tell you that there was an “Error establishing a database connection.” While this is annoying, just remember that it’s really common and easy to fix. There are three ways to attempt to resolve this, one being that you need to talk to your hosting provider to find out if the database shutdown was on their end for exceeding a quota or because of a server issue.
If it’s not a hosting issue, you could be dealing with a website hacking. Since WordPress is vulnerable to security threats, it can be a top target for hacks. Scan your website with a security tool, change your login details, and then restore the site from the backup.
If it’s neither of these issues, it may simple be a wp-config.php file error. Open up the file using the file manager, check if your username, password, host, and database name are all correct, and then correct anything that’s incorrect.
Email and password retrieval error
Sometimes people forget their username or password and need to retrieve a new one. You can usually click on the “lost password” link, but if you never received the resent link to your inbox, you may need to edit your functions.php file or reset it through phpMyAdmin.
The first option would have you put your new password in the functions.php file of the theme’s functions and place it where it says “DesiredNewPassword.” The other option would have you log into your cpanel, click phpMyAdmin, and edit the record under the wp_users table. Don’t forget to convert your password into MD5 if you do it this way, since phpMyAdmin uses MD5 encryption.
500 Internal Server Error and Connection Timed Out
Lastly, you may run into a Connection Timed Out error or the 500 Internal Server Error. Don’t panic with these errors because they have straightforward fixes. With a Connection Timed Out error, it’s likely from a heavy plugin, an error with the theme function, or a maxed out PHP memory limit, but you can simply increase the memory limit, deactivate your plugins, or switch to your default theme to see which issue is the source of the problem.
With a 500 Internal Server error, you’ll want to figure out if it’s a corrupted theme function or plugin function, a maxed out PHP memory limit, or a corrupted .htaccess. Simply try to increase your memory limit, deactivate plugins, edit your .htaccess file, and replace wp-admin folders with a fresh one.
While an error on your WordPress site can feel stressful, it’s usually a straightforward resolution. Try these fixes next time one of these errors pops up for you.