Fueling about 28% of the internet, WordPress is a prominent name in the web development realm. The foolproof CMS allows everyone to create a website virtually at record speed. And it doesn’t stop here! Thanks to its abundant number of plugins, there’s almost nothing that a user cannot accomplish through WordPress.
Despite its ease of use, there are some common WordPress errors that can panic you as a developer. The good thing is that the WordPress error you see on your site is most likely been reported and resolved by someone before you. The other features provided by the plugins can hide weighty flaws baring your website to errors and bugs which only ever show themselves at the worst possible moment.
Let’s take a look at some of the more common types of WordPress bugs and how to fix them:
1. The White Screen of Death
This is one of the most important errors a WordPress user can face. This can be due to multiple reasons, which is certainly not easy to pinpoint the source of the problem. However, the following points are believed to be the most common causes for the White Screen of Death.
• Plugin collision with active theme
• Plugin collision with another plugin
• Incompatible plugin with current version of WordPress
• Incompatible theme with latest revision of WordPress
• Plugin-theme collision: In many cases the theme might have some code that the plugin you most recently activated using; thereby causing a deadlock.
1. Resetting the WordPress Plugin Directory:
To reset the WordPress plugin directory, you must have the access to the WordPress installation folder. This can be done by using the FTP access, SSH, cPanel, or any web-server control panel’s file manager. For instance, Dreamhost and FatCow do not use cPanel, but have their own file manager.
• Rename the plugins directory to plugin-temp
• Create a fresh directory called plugins and change the permissions to 644
• Restart your web server if you have SSH access, are on a VPS or a dedicated server.
By following the above, all your previously activated themes will get deactivated and removed. You can now try logging into your WP dashboard. If it works, then you can start moving the plugins one by one, starting with the trustworthy ones and move forward.
2. Renaming the Active Theme:
When you rename a currently active theme, WordPress is unable to find it. It then looks in its default them. When found, it switches over to either of the themes and you might be able to access your dashboard once again.
2. 500 Internal Server Error
The most certain cause of a 500 Internal Server error is a corrupt .htaccess file in the base/root directory of your WordPress installation. In 90% of the cases, the problem gets solved by deleting the .htaccess file and creating a new one. To delete the file, login to your WordPress root directory through FTP and rename the existing .htaccess file to something like .htaccess-corrupt. Then, immediately login to your WordPress dashboard and head over to the Permalinks option under the Settings. Select your preferred permalink option and Save the changes. Your WP site should work fine now.
There are other causes for the 500 Internal Server Error as well, but they vary quite much and are hard to pinpoint. Other troubleshooting methods include renaming the theme, resetting the plugin directory and replacing the WP-admin and WP-includes folders with fresh ones from the most recent WordPress-latest.zip file.
3. Error Establishing A Database Connection
This is one of the most common errors faced by WordPress Beginners. It is easier to fix as compared to the WSOD problem since we know the cause of the error.
The most common cause is the MySQL database access being incorrect. As a result, WordPress cannot connect to the database, thus, being unable to function. The other reasons include:
• The MySQL server is down
• The MySQL user does not have the apt permissions to modify the database.
• In case of incorrect login details, it is important and helpful to verify them.
• Make sure that your password is within single quotes. If your password happens to contain a single quote, then make sure that you enclose the password string with double quotes and vice-versa.
• If the MySQL user doesn’t have the required privileges, assign them using the MySQL Database option available inside the cPanel.
• If the MySQL server is down, try restarting it if you have SSH access. If not, contact your hosting provider.
4. Failed Automatic WordPress Update
At times, due to overloaded servers or connection issues, the automated WordPress installation gets interrupted and you are either left with tons of error messages or a WSOD. To resolve this, you can follow the manual upgrade steps and resolve the issue in no time.
• Download the latest version of WordPress and extract the contents in your system
• If possible, deactivate all the plugins
• Login to your WordPress root directory using FTP and swap the files in the base directory with the new ones in the extracted folder.
• Resultantly, delete the wp-admin and wp-includes directories
• Upload the freshly extracted wp-admin and wp-includes folders to your root directory
• Route to your wp-content directory present in the webserver via FTP
• Rename/ Replace/ overwrite the files inside this directory with the ones in the freshly extracted wp-content directory
• Never delete the wp-content directory in your webserver – or you might lose all your saved media
Worth Reading [What is Clean Code and Why it Matters?]
5. Error Establishing A Database Connection
This is one of the most common errors committed by the WordPress Beginners. It is easier to fix as compared to the WSOD problem, since we know the cause of the error.
The most common cause is: one of the MySQL database access details being incorrect. Resultantly, WordPress cannot connect to the database and thus, not functioning properly.
The MySQL server is down
The MySQL user does not have the appropriate amount of permission to modify the database.
In case of incorrect login details, verify them.
• Make sure your password is within single quotes. If you password happens to contain a single quote, make sure you enclose the password string with double quotes and vice-versa.
• If the MySQL server is down, try restarting it if you have SSH access. Else, contact your hosting provider
• If the MySQL user does not have the required privileges, assign them using the MySQL Database option available inside cPanel.
The above mentioned are some of the most common WordPress errors faced by web developers. It is worth knowing that most of the PHP related errors such as maximum execution time exceeded, connection timed out, fatal error could indicate a poor web host, or one that is not properly set up to handle WordPress. It is recommended to consult the customer support or get in touch with a professional web application development company who can do these tasks for you.