What Are 402, 403, 404, and 500 WordPress Errors and How to Fix Them?

Written by AshishSharma31 | Published 2018/05/04
Tech Story Tags: wordpress | 402-error | 403-error | error-404 | 500-error

TLDRvia the TL;DR App

There is no doubt that WordPress is one of the most versatile CMS out there. However, the disadvantage of having this much control over a site is that a single wrong move can bring the entire site down and in the worst case can even delete the entire content on the website.

Luckily for WordPress users, there are many guides available online on various WordPress errors and how to fix them. However, the least talked about errors are the 402, 403, 404, 500 and 502 Bad Gateway errors on WordPress.

Today, we have compiled an article detailing on what these errors actually are and how you can fix them.

How to fix Error 402 on WordPress?

The Error 402 is caused most probably because of any faulty plugin or theme installation on your WordPress site.

The problem with Error 402 on WordPress is that it does not let site owners log in to their admin dashboard as well. In such case, below is how you can manually reset the plugins on themes of your site without having access to the admin panel.

  1. Login to your hosting cPanel.
  2. Find “PHPMyAdmin” and click on the same.
  3. Click on the database of the WordPress site facing the error 402.
  4. In the “wp_options” table, under the field “option_name”, find the row that says “active_plugins”.
  5. Change the value of “option_value” for “active_plugins” to “a:0:{}”.
  6. Save the changes.

If manually resetting plugins did not resolve the Error 402 on your WordPress site, then try disabling the theme on your WordPress site by following the steps below.

  1. First of all, download and install an FTP (File Transfer Protocol) client.
  2. Login to your server by entering the required credentials to the FTP client.
  3. Now, from the root database folder, navigate to the “wp-content” folder and then click on the “themes” folder.
  4. Navigate to the root folder of the theme that is running on your site.
  5. Rename the root folder of the current theme on your site to something that can be remembered later.
  6. This will disable the current theme and load the default WordPress theme on your site.
  7. Save the changes.

If disabling the WordPress theme also did not help you resolve the error 402, then try contacting the hosting provider for a resolution as at times the error 4402 also happens because of server related issues.

If resetting the plugins helped you resolve the error 402 issue, then try manually toggling each plugin installed on your site until you find the plugin causing the error.

How to fix Error 403 on WordPress?

The Error 403 on WordPress appears when the server is not permitted to access a specific page. The 403 error can appear in different places, like while installing WordPress, while logging into the dashboard, or while visiting any specific webpage on the site.

The Error 403 on WordPress is again caused by faulty plugin installations in most cases. To resolve the Error 403 issue, you can try resetting the plugins manually by following the guide written above.

How to fix Error 404 on WordPress?

The Error 404 is probably the most encountered error on WordPress. The Error 404 appears when trying to access posts or specific content on a website.

In most cases, Error 404 is related to the permalink settings of your WordPress site and below is how you can easily fix it.

  1. Login to your WordPress admin dashboard.
  2. From the side panel, click on the “Settings” option.
  3. From the drop-down menu that appears, click on the “Permalinks” option.
  4. Now when the permalinks page loads, without making any changes, click on the “Save Changes” option.

Now try accessing the pages that were showing Error 404 earlier. The above method will update the settings related to permalinks of your site and should probably fix the issue.

If not, then you will need to edit the “.htaccess” file of your WordPress site by following the below steps.

  1. Use an FTP client to login to your web server.
  2. Now, navigate to the “.htaccess” file and click on the same. The “.htaccess” file can be found in the same root folder that holds the “wp-content”, “wp-admin”, and “wp-includes” folder of your site.
  3. Add the below code to the .htaccess file: # BEGIN WordPress <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteRule ^index\.php$ — [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] </IfModule> # END WordPress

  4. Save the changes.

Now load the web pages that earlier displayed the Error 404 message. The error should now be resolved.

How to fix Error 500 on WordPress?

The Error 500 appears either because of a corrupted .htaccess file on your site or because of PHP Memory Limit issues.

Follow the steps below to rename the “.htaccess” file and resolve a corrupted .htaccess file issue.

  1. Use a FTP client to login to your web server.
  2. Now, find the “.htaccess” folder and right-click on the folder name.
  3. Rename the folder name to “.htaccess_older”.

Now reload the web page and the error must be gone.

To recreate .htaccess file on your site, follow the below steps:

  1. Login to your WordPress admin dashboard.
  2. Click on “Settings” option from the side panel.
  3. Then click on “Permalinks”.
  4. Click on the “Save Changes” option without making any changes to options.

And that’s it. You have now created a new .htaccess file for your site.

If renaming the .htaccess file did not resolve the error, then try following the guide below to increase the PHP limit in order to resolve Error 500.

  1. Login to your site server using a FTP client.
  2. Find and download the “wp-config” folder which should be present in the same root folder as “.htaccess”.
  3. Use a code editor tool and open the downloaded wp-config.php file.
  4. Once the file opens, find the text “That’s all, stop editing!Happy Blogging” within the file.
  5. Before the above line, paste the below code and save the file: define(‘WP_MEMORY_LIMIT’,’300M’);

  6. Upload the edited wp-config.php file back to the same directory from where you downloaded it.
  7. If prompted to overwrite the existing file, allow for the same.

And that is it. Try reloading your site and the error should be solved now.

For 502 Bad Gateway errors, you can refer the well-detailed guide written by the folks at 000webhost.com and fix the problem.

Final Words

Hope we were able to help you out in resolving the mostly encountered errors on WordPress.

If you have any doubts regarding the above article, please do leave a comment below and we will surely guide you with it.


Published by HackerNoon on 2018/05/04