As we all know, using WordPress is uncomplicated. But there are some errors in WordPress that can agitate you. However, these errors are common and already resolved by someone and they are really not that big of a deal!
In this article, you will gain insight into the most common errors in WordPress and how to fix them.
1. 500 Internal server error
As a beginner, the most confusing error you will come across is “Internal Server Error” or “500 Internal Server Error”. Usually, this error appears when the server is unable to identify the source of an unknown problem. The error message does not guide you to the reason. Therefore, it is on you to figure this out.
How to fix this?
The internal server error can happen with any site operating on a web server. It is not specific to WordPress. Generally, this error is caused by a theme function or a plugin. Corrupted .htaccess file and PHP memory limit can also cause this problem.
Corrupted .htaccess file
Check for the corrupted .htaccess file – to check this file, just rename your main .htaccess file to get your site running. To access this file, login to your site using your FTP or File Manager app in your account’s cPanel dashboard. The .htaccess file is located in the directory that includes folders like wp-content and wp-admin.
Try visiting your site after you have renamed the file. If this solution worked for you, then give yourself some credit because you just fixed the internal server error.
Do remember to save the changes in the Permalinks page to generate a new .htaccess file so that you do not get back a 404 error!
If this solution did not work for you, continue reading this article.
PHP Memory limit
Completely consuming your PHP limit can return internal server error. If this error is showing up when you are logging into your WordPress admin or uploading an image, then increasing the memory limit should help if you follow these steps.
- Create a blank text file called php.ini
- Add this following code memory_limit= 128 MB
- Save the file
- Using FTP, upload the file into your /wp-admin/ folder.
This fix works temporarily, you still need to look for the reason that is exhausting your memory limit. A poorly coded plugin or a theme function can be the root cause of this. Discuss with your hosting company to help you find the exact problem.
If you are still reading this article, then there is more troubleshooting to be done.
At this point, we can conclude that the error is being caused by a specific plugin or a combination of aloof plugins.
Deactivating all the WordPress plugins is the only fix since there is no easy way of knowing the problem causing plugin.
Re-uploading the core files
If the plugin solution did not fix the error, then it is time to freshly install WordPress and reupload wp-admin and wp-includes folder.
This move will not only retain your information, but it might end up solving the problem if any file was corrupted.
Install and extract the zip file to find a WordPress folder. Now, connect to your WordPress website using an FTP client. Go to the root folder of your website and open the WordPress folder on the left column of your computer. Select wp-includes and wp-admin folders and right-click to choose Upload. Select Overwrite when asked. Your FTP client will replace your old WordPress files with fresh copies.
This step will surely fix the internal server error if your WordPress files were corrupted.
2. The WordPress White Screen of Death
A plain white screen with no error message certainly puts one into panic mode. If you find yourself staring a blank screen and have no idea how to fix this next section is for you.
Usually, this error is caused when a running script exhausts the PHP memory limit. A configuration in the server can also be one of the reasons. The white screen of death also appears on certain sections of the website. This is the most common WordPress error and also very frustrating since there is no error message.
Your web hosting server kills the unresponsive script or the script times out. Hence you don’t see an error message on your screen.
Again, a poorly coded plugin or a theme can cause this error. Sometimes, an issue with your web hosting server might be the reason.
Bringing it back to life…
WordPress Recovery mode
WordPress 5.2 was equipped with a new fatal error protection feature that can identify the error causing plugin or theme. Instead of a white screen, ‘the site is experiencing technical difficulties’ message will be shown. You will also be notified through email that includes details about the error and the plugin. A unique link in the message will allow you to log in to the WordPress recovery mode and disable the troublesome plugin.
Debug mode in WordPress
Enabling the debugging will let you see the type of errors that are outputted.
Add the following code to your wp-config.php file;
1. define( ‘WP_DEBUG’, true);
2. define( ‘WP_DEBUG_LOG’, true );
Adding this will make the blank screen show the errors, notices, and warnings which can help in figuring out the root cause.
A Caching plugin can cause the front end of your site to go blank even though you have access to the back end. Your best move is to simply empty our cache.
You can use the previous solutions like increasing the PHP limit and disabling plugins as a solution for this error as well.
2. The infamous ‘404 – page not found’ error
The 404 – page not found error pops up when a specific post on the website is being visited by the use. The most common reason for this is an issue with permalink settings in WordPress.
Even though the user can access the admin area, this error creeps up when accessing a single post. Do not let this error bother you about the posts, they will be completely safe.
Fixing this is very easy!
Go to your Settings >> Permalinks and click on the save changes button.
This should update your permalinks settings. This will, in most cases, fix the error.
If this does not help, then you will have to manually fix your .htaccess file. Login to your server using FTP and modify the .htaccess file. Temporarily make the file writeable by changing the permissions to 666 and repeat the solution. Remember to replace the permissions back to 660.
3. ‘Are you sure you want to do this” error
This is error may appear in the WordPress admin area. A plugin or a theme that fails to use Nonce properly is the primary cause for this error.
Nonce? Yes, Nonce. Nonce are special security keys that add a layer of security to URLs and forms from abuse.
There are too many factors that can cause this error and hence WordPress cannot point you in the right direction to overcome this.
Are you are ready to fix this?
Start with the plugins
First, deactivate all your plugins so that WordPress is unable to locate the installed plugin. Connect to hosting account through the FTP client and rename the plugins folder to plugins.deactivated. Go back to your plugins page and try to reproduce the error by switching on every deactivated plugin.
If the plugins were not the problem, then it might be your theme that is causing the error.
Repeat the same procedure you did for the plugins to find out the error causing theme. Don’t forget to backup your currently active theme, so that you can delete it from the web server.
If the error does not show up after activating the default theme, then it is most likely the theme that was causing a problem
4. 403 forbidden – access denied error
When your server permissions deny you from accessing a specific page, 403 forbidden error code is shown.
The most prevalent cause for this error is poorly configured security plugins. If WordPress security plugins think that an IP address is malicious, then the IP address gets blocked.
Corrupt .htaccess files and incorrect file permissions on your server can also cause this error.
Sometimes, it might not be you, but your hosting company, making accidental changes to their server settings, resulting in a 403 forbidden error on your site.
……And the solution!
Temporarily deactivate all your WordPress plugins, even the security plugins. If this solves the error then a plugin was causing this error. Again, try the error reproducing procedure to pinpoint the problematic plugin.
File permissions in WordPress
Every file that is stored on your website has file permissions. The file permissions control the access of files and folders on your website.
Entering incorrect file permissions can cause the webserver to regard you as a trespasser trying to access the files. This will cause a 403 forbidden error.
Ask your hosting provider to investigate your website for correct file permissions.
Changing file permissions by yourself can cause serious troubles. Look for professional help.
If you still want to do it b yourself then here are the steps you need to follow;
- Connect to your site using an FTP client.
- Go to the root folder that contains all the WordPress files.
- Click and select a folder, right-click to choose file permissions from the options.
- Set the file permission to the root folder to 744 or 755 in the dialogue box.
- Check the box next to Recurse into subdirectories and also check the option apply to directories only.
- Click the OK button. Your FTP client will start setting the permissions to all subdirectories in that folder.
- Repeat this process for all the files. This time around, you will be using file permission of 644 or 640.
After completing the process, try accessing the website. The 403 error should be gone!
5. ‘This site ahead contains harmful programs’ Error
If a site is found to have any suspicious code that could be trojan or malware, then Google marks the website with this warning.
This could potentially mean that your website is hacked and is being used to distribute malware. Even after fixing the hack the error might show up.
Showing low quality advertising networks can also be the reason because these networks may display links to sites sharing malicious code.
How to get rid of this error?
Ridding your website of malware is a complicated task. Even after a thorough cleaning of the site, you might notice that the malicious code keeps coming back. To stop this from happening, you are required to find the backdoor placed on your website.
Backdoor? Backdoor is a method of gaining ability to remotely access the server, bypassing normal authentication, and remaining undetected. It could be a compromised password , unsafe file permission or a disguised file.
You will still need to thoroughly go through your database for malicious code after successfully removing the backdoor.
If you are absolutely sure that your website is clean, then you can ask Google to remove the warning from search results. For that, you can use Google webmaster tools.
Choose the security issues in webmaster tools. The page will list the security issues found on your website. Once these issues are fixed, request a review. Report for incorrect phishing warning if there were no security issues in the webmaster tools.
As we reach the end of this article, you must be wondering what is wrong with the plugins. There is absolutely nothing wrong with them, it is just that sometimes they are poorly. Just be sure to get the right ones for your site.
Now that you know how to fix these errors, there is no reason to panic if they show up on your screen next time! We hope these solutions will be of some help.
“From the errors of others, a wise man corrects his own” (same holds for website errors!)