Debugging

How to Fix These 5 Common WordPress Errors

Do these sound familiar? White screen of death. Locked out of the admin. 404 not found. 500 internal server error. I could go on and on, but these are some of the most common errors and issues you will encounter when dealing with a WordPress website. So, if you are close to pulling your hair out or hiding somewhere thinking and hoping that maybe tomorrow everything will be fixed, and all is going to be right in the world again, don’t worry. You are not alone. It is not the end. WordPress is a stable platform, but there is nothing out of the ordinary about encountering issues. Keep reading to learn how to fix common WordPress errors (without going bald).

WordPress has a huge 35% share of the internet pie. More often than not, the issue you’re having has been documented somewhere with a fix added in for good measure.

Outlined below are five of the most common WordPress errors and issues and how to fix them in the easiest possible way. There will be minimal hand-holding here; you will need to figure out how to get to where you need to go to make changes.

Most of the fixes described below will require you to have some PHP knowledge, knowledge of the WordPress Admin, and an understanding of how to use your hosting platform’s tools. But mostly, you’ll just need common sense and the ability to follow instructions to a T.

Issue 1: Locked Out of WordPress Admin

Scenario: You forgot your password and you don’t have access to the recovery email address.

Fix: The easiest way to fix this WordPress error is to do it via PHPMyAdmin using a SQL statement.

Log into your hosting’s admin panel, then open phpMyAdmin. Select your WordPress Database from the left column, then select the SQL tab and add the following code. Make sure that you’ve changed `new_pasword` and `your_username.`

UPDATE `wp_users` SET `user_pass` = MD5( 'new_password' ) WHERE `wp_users`.`user_login` = "your_username";

However, if you want to create a new admin user, you can drop this instead (make sure to change the values to the right ones).

INSERT INTO `databasename`.`wp_users` (`ID`, `user_login`, `user_pass`, `user_nicename`, `user_email`, `user_url`, `user_registered`, `user_activation_key`, `user_status`, `display_name`) VALUES ('4', 'username', MD5('password'), 'Your Name', '[email protected]', 'http://www.website.com/can-be-blank', '2011-06-07 00:00:00', '', '0', 'Your Name');

INSERT INTO `databasename`.`wp_usermeta` (`umeta_id`, `user_id`, `meta_key`, `meta_value`) VALUES (NULL, '4', 'wp_capabilities', 'a:1:{s:13:"administrator";s:1:"1";}');

INSERT INTO `databasename`.`wp_usermeta` (`umeta_id`, `user_id`, `meta_key`, `meta_value`) VALUES (NULL, '4', 'wp_user_level', '10');

 

Issue 2: Maintenance Mode Error

Scenario: You updated your theme and/or plugin and somehow it did not go through the whole process and now you’re stuck in Maintenance Mode.

Fix: There are a lot of fixes to this, but if you need your website up and running in the shortest time possible, you will need to access your website files and you can do that via FTP, your host’s File Manager, or by using an SSH connection. You will need to delete just one file that sits right at the root of your website files -> .maintenance

FTP

 

 

File Manager

SSH Connection

Connect via SSH to your server. Navigate to your website’s root folder and type the following code:

rm .maintenance

Issue 3: HTTP Image Upload Error

Scenario: You could not upload and have the same issue with any image you try to upload no matter the file size. You went through the basic troubleshooting: disabled plugins, default theme, but nothing works. All you can see is a generic HTTP error. There is no explanation, just that you can’t upload anything. It is not a glitch nor a plugin conflict. What else can you do?

Fix: There are three fixes to this WordPress error that you can try:

Increase Memory Limit

Edit your wp-config.php file, found at the root of your WordPress site. Add the following right above where it says: /* That’s all, stop editing! Happy blogging. */

define( 'WP_MEMORY_LIMIT', '256M' );

 

Shared Hosting? Use the .htaccess Hack

Imagick(ImageMagick) is one of the two modules WordPress uses to handle images. And shared hosting usually limits Imagick’s ability to use multiple threads. To fix this error, edit your .htaccess file and add the code below right at the top of your .htaccess.

MAGICK_THREAD_LIMIT 1

 

Ditch Imagick and Use GD Library Instead

Command Tell WordPress to use the GD Library to handle images by adding the code below to your theme’s functions.php file.

wp-content -> themes -> your-theme -> functions.php

function wds_default_image_library( $editors ) {
$gd_editor = 'WP_Image_Editor_GD';
$editors = array_diff( $editors, array( $gd_editor ) );
array_unshift( $editors, $gd_editor );
return $editors;
}
add_filter( 'wp_image_editors', 'wds_default_image_library' );

Issue 4: 404 Not Found Error

Scenario: Out of nowhere, a page on your website is no longer accessible and serving you NOTHING. Nada. Zilch. You might have enabled or disabled a plugin, maybe changed a theme. You’ve already cleared your cache and you know you have the right URL.

Fix: The first thing you can try is to reset your WordPress permalinks. You can just click the Save Changes button and that will reset your permalinks without you changing anything. But, I usually do the extra step of setting it to Plain first and then save. Go check on the post or page to see if it works. If it does, put it back to Post name or whatever your chosen permalinks setting is.

WordPress Dashboard -> Settings -> Permalinks

One extra step to try, if just resetting won’t work, is to rename your current .htaccess to something else. The .htaccess file sits right at the root of your WordPress files. You can then create another .htaccess file and copy the default one below for versions 3.5 and up. If you are running a WordPress Multisite or version 3.4 and below, check this WordPress Support article for the .htaccess to use.

# BEGIN WordPress

RewriteEngine On
RewriteBase /
RewriteRule ^index.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]

# END WordPress

After doing that, go through the process of resetting your permalinks again to see if it works. If it does not, change to a default theme. If it works, then the issue is with your theme.

Issue 5: 500 Internal Server Error

Scenario: This is another generic error that does not exactly tell you what’s wrong with your website. All you know is that your website is currently NOT WORKING.

Fix: If you can access your WordPress admin start at step 1. If not, start at step 3.

  1. Disable plugins. Did it work?
    • No – Continue troubleshooting below.
    • Yes – Try to enable your plugins one by one to find the culprit. (Another tip is to create a folder inside /plugins called /disabled [the name doesn’t matter], then move any plugin that you suspect might be hanging the site into that folder to immediately disable it.)
  2. Change to the default theme. Working?
    • No – Down the rabbit hole…
    • Yup – Check your theme for errors and see if you can fix it. If you can’t, find another theme that works for you or create your own. WebDevStudios’ wd_s is a pretty great starter theme to use.
  3. Check if your .htaccess file is corrupt. Rename your old .htaccess and create a new one. Go through the same fix outlined above for Issue 4: 404 Not Found. How about now?
    • Still nothing – Put your thinking cap on and move to the next step.
    • YES!!! – Pour yourself a glass or two and make sure to create a backup of your website.
  4.  Create a backup. Download a new copy of WordPress here. Connect to your site via FTP, delete wp-admin and wp-includes folders. IMPORTANT: LEAVE wp-content ALONE. Once done, upload the wp-admin and wp-includes folder to your server.
    • Nothing is working – It’s time to call customer support and check with them if they can help you fix it.
    • Everything is back to the way it should be.

 

There are lot of other fixes for these errors that you can find online, but the ones outlined in this blog post are my usual go-tos before I do anything else. They work almost all of the time. Just make sure that before you do any kind of change to your website files, your first step should always be: back up everything.

Need help creating a WordPress website that works, error-free?  Contact WebDevStudios today.

Comments

2 thoughts on “How to Fix These 5 Common WordPress Errors

  1. Maintenance Mode Error, HTTP Image Upload Error and 404 Not Found Error happens a lot. 404 usually happens on migrations based on .htaccess being missed or manipulated.

Have a comment?

Your email address will not be published. Required fields are marked *

accessibilityadminaggregationanchorarrow-rightattach-iconbackupsblogbookmarksbuddypresscachingcalendarcaret-downcartunifiedcouponcrediblecredit-cardcustommigrationdesigndevecomfriendsgallerygoodgroupsgrowthhostingideasinternationalizationiphoneloyaltymailmaphealthmessagingArtboard 1migrationsmultiple-sourcesmultisitenewsnotificationsperformancephonepluginprofilesresearcharrowscalablescrapingsecuresecureseosharearrowarrowsourcestreamsupporttwitchunifiedupdatesvaultwebsitewordpress