Nine of the Most Common WordPress Problems and Their Solutions

WordPress is stable software and operates without issues most of the time. However, at times, things may go a little haywire, and your WP website can refuse to function normally.

Have you ever encountered a white screen after adding some new themes or plugins? Maybe you were just updating your WordPress website and that update now refuses to finish, and your website is in eternal maintenance mode? What about internal server and database connection errors?

If you have encountered any of the above problems and are looking for the solution to them, you have come to the right place. In this article, we shall be taking a look at some of the most common WordPress problems and ways in which we can solve them. 

Featured Plugin - WordPress Q&A Site Plugin

It's now incredibly easy to start your own Q&A site using nothing more than WordPress - The Q&A plugin simply and brilliantly transforms any site, or page, into a perfect support or Q&A environment.
Find out more

1. 500 Internal Server Error

What

Your site was working fine, and then, when you wake up the next day, this is what you find:

500 Internal Server Error

Why

The most common cause of a 500 Internal Server Error message is a corrupt .htaccess file. Additional causes can be a conflicting plugin or theme, or even a corrupt WordPress installation.

Sometimes, PHP memory limits may also cause a 500 Internal Server Error. The easiest way to figure out where the problem lies is to check your website’s error_log (many shared web hosts often do not enable full error logging, though). To find out more, you can enable WP_DEBUG and check for error logs. Open up your wp-config.php file, and locate the following line of code:

define(‘WP_DEBUG’, false);

And change it to:

define(‘WP_DEBUG’, true);

The Cure

Since the most likely cause behind the error is a corrupt .htaccess file, let us tackle this one first.

You will need FTP access on your server. Navigate to the root directory of your WordPress installation, and locate the .htaccess file. Rename the file to, let us say, something like .htaccess_old

Now reload your website. If it works, congratulations! You can now generate a new .htaccess file simply by navigating to Settings–>Permalinks in your WP admin panel and re-saving the settings.

You can also try deactivating your plugins and themes because sometimes a 500 Internal Server Error can be caused by a faulty plugin or theme as well. Alternatively, you can try increasing your PHP Memory Limit to ensure that the memory limit is not the cause of the error. You can find detailed instructions regarding memory limits on the WordPress Codex.

If all else fails, you will need to grab a fresh copy of WordPress from the official site, and then re-upload the wp-admin and wp-includes directories.

2. White Screen of Death

What

As the name suggests, a White Screen of Death means when you access your website, you see nothing but a blank page.

“White” Screen of Death

Why

There can be multiple reasons behind a WSOD, the most common ones being compatibility issues with a plugin or a theme. Of course, the “incompatibility” itself can have multiple faces: a plugin may have a conflict with another plugin, or a plugin may not be compatible with the latest version of WP. Similarly, a theme may also experience compatibility issues with WordPress after an update.

The Cure

Plugins and Themes Folders in WP Install Directory

The easiest solution is to first isolate your plugins’ directory. To do so, navigate to the root of your WP installation via FTP (assuming you cannot, at all, access your website and all you get is a WSOD), and then head to /wp-content. Locate the folder named “plugins” and rename it (let us say, “plugins_old”). Create a new folder named “plugins”.

This will isolate all your plugins, and if your website works fine, then yes, one of your plugins is at fault. Do not open your plugins page at this point, else you may end up deactivating all your plugins.

Once you have verified that one of the plugins is behind the WSOD, you can copy individual plugin files from “plugins_old” to plugins”, one by one, to check which one is causing the WSOD.

For themes, the procedure is even simpler. Navigate to /wp-content/themes, and then rename the folder of the active theme. Next, open up your WP admin panel, and head to the Themes page. This will cause WP to fall-back to the default theme (Twenty Twelve, Twenty Eleven or Twenty Ten, depending on your WP installation version). You can find detailed step-by-step analysis here.

3. Maintenance Mode Error

What

This error:

Why

Each time you update WordPress to a newer version, it makes a temporary .maintenance file. Problem occurs when the .maintenance file is not removed properly after the upgrade (in many cases, this happens when the upgrade process itself fails to complete successfully).

The Cure

You will need to login to your WP root directory via FTP. Thereafter, you can locate the .maintenance file and delete it. This will resolve the error.

If, however, you are experiencing difficulties with the automatic update, the solutions are different, and James Dunn has a guide to help you out.

Featured Plugin - WordPress Ecommerce Shopping Cart Plugin

Out of all the WordPress ecommerce plugins available, MarketPress has got to be the winner - easy to configure, powerful functionality, multiple gateways and more. A simply brilliant plugin!
Find out more

4. Error Establishing A Database Connection

What

If you get the above error when you try to access your website, it means WordPress is experiencing a problem when trying to access the database.

Why

The direct cause can be an issue with the wp-config.php file — most likely, details related to your database have been entered incorrectly.

However, most of the time, database connection errors occur due to a problem that can be solved only by your web host (especially if you are on a shared hosting server). Most shared web hosting providers keep limits on databases, and if your database crosses the allotted quota, you can receive a connection error. Plus, database connection errors also occur if your web server is down.

Lastly, sometimes a hacked website can also result in database connection issues.

The Cure

First up, the wp-config.php file. Locate the file using FTP, and open it. You can then go through it to ensure that database details are correct (database name, username, password and database host).

If you think your website has been hacked or compromised, you will have to work towards cleaning it up. You can use Sucuri SiteCheck to ensure that your website is clean — more details about securing a WP website can be found in this article. WordPress Codex also has an FAQ to help you out.

Lastly, if your web server is down or if your database has reached the allotted quota, you will obviously need to get in touch with your web hosting provider.

5. Connection Timed Out

What

An error that you receive from an overloaded server (or a badly configured server).

Why

It generally happens when the website’s server is too overloaded and is unable to complete your browser’s request. Nothing puts it more eloquently than the WordPress Codex:

The Connection Timed Out error appears when your website is trying to do more than your server can manage.

The Cure

The first step is to deactivate your plugins. If this cures the problem, try re-activating them one by one to see which plugin is causing the issue. Alternatively, if it is a problem related to your current theme, activate the default WP theme.

You can also increase your PHP memory limit using the wp-config.php file. Open the file, and add the following line of code to it:

define(‘WP_MEMORY_LIMIT’, ’64M’);

This will increase the memory limit to 64 MB. You should note, however, that if you are on a shared web host, you may not be allowed to increase your memory limit beyond a certain point. In this case, you will need to contact your web host to increase the memory limit for you. Also, bear in mind that many shared hosting providers keep the PHP memory limit as low as 8 MB.

Lastly, if you have access to your php.ini file, you can also consider increasing the maximum execution time.

Featured Plugin - WordPress Wiki Plugin

To get a wiki up and running you used to need to install Mediawiki and toil away for days configuring it... not any more! This plugin gives you *all* the functionality you want from a wiki, in WordPress!!!
Find out more

6. Error 145

What

Error 145 means that your WordPress database is damaged or corrupted.

The Cure

The easiest way to repair your WP database is using phpMyAdmin.

Once you login to phpMyAdmin, choose your WP database. You will then need to select the checkboxes next to tables that you wish to repair. Once selected, you can choose the “Repair Table” option from the drop-down menu right below the list of tables.

Repairing Tables Using phpMyAdmin

Note: Always create a backup of your database before making changes to it.

7. Error 28

What

Error 28 is more of a MySQL error and is not related to WordPress. Even Drupal, Joomla! or other CMS’ websites can experience it.

Why

Error 28 can occur if the cache on your web server is full or if you have too many files in your /tmp directory.

The Cure

If you can, then try to empty your /tmp directory. Alternatively, you should contact your web host to help you resolve the cache related issues.

8. Warning: Cannot Modify Header Information — Headers Already Sent

What

Sometimes, you may encounter an error that goes along the lines of: “Warning: Cannot modify header information — headers already sent by (output started at /path-to-something-directory/some-config-file:xyz )”.

Why

This error is caused by the unrequired spaces in the mentioned WordPress file (generally, it is the wp-config.php file). Naturally, you will need to edit the concerned file to remove the unnecessary whitespaces.

The Cure

Remove Extra Spaces From wp-config.php File

Download the file that is mentioned in the error (say, wp-config.php). Open it using an editor of your choice, and then ensure that there are no spaces either before <?php or after ?> tags. Overall, the first letters of the file should be <?php and the last letters should be ?> (with absolutely no spaces between ‘?’ and ‘<’ or ‘>’ either).

As already mentioned, most of the time this error happens due to spaces in the wp-config.php file. It can be some other file too, though — just read the error carefully because it specifies the file name and the path to the concerned file.

9. Warning: File_Get_Contents

What

An error such as this one:

Warning: file_get_contents (http://www.url.com/url) [function:file-get-contents]: failed to open stream on line xyz

Why

Most of the time, such errors occur because your web host has strict security settings in the PHP configuration (“security” not as in to prevent hacks, but to prevent overuse of server resources, etc.).

The Cure

If you have access to php.ini file, you can resolve the error yourself. Open the file, and locate the following line:

allow_url_fopen = Off

Now change the “off” value to “on”, as follows:

allow_url_fopen = On

If you do not have access to your php.ini file, you will need to contact your web hosting provider and ask them to enable allow_url_fopen. Also, if this error is followed by a message such as “failed to open stream: no such file or directory in…”, it can mean that the mentioned file is either missing or not readable (look for it in the specified path, and if you find it, check its file permissions).

There you have it — solutions to the most common WordPress errors! Got an error message or a solution of your own that I missed? Share it in the comments below!

Featured Plugin - WordPress Facebook Plugin

Would you like to add Facebook comments, registration, 'Like' buttons and autoposting to your WP site? Well, The Ultimate Facebook plugin has got that all covered!
Find out more

Photo: vector warning sign from BigStock

Tags

Comments (16)

  1. Great article… you have posted most of the problems currently faced in WordPress.. Luckily i have been able to solve it ..

    There is another problem which is common with WordPress…. Atleast i face it every time i install a fresh WordPress soft…

    The problem is that every time you install a plugin, you have to enter the FTP access information to continue.. which can be easily solved by the code provided below:

    Just add the following lines of code in your wp-config.php page..

    //*added ftp login credentials to avoid WordPress asking for FTP details every time I wanted to upgrade a plugin*
    define(‘FTP_HOST’, ‘Hostname’);
    define(‘FTP_USER’, ‘user’);
    define(‘FTP_PASS’, ‘pass’);
    //*If you can use a SSL connection set this to true*
    define(‘FTP_SSL’, false);

    that will solve it…

    I hope i helped…

    • Hiya,

      That is a nice share. Even I have faced that a couple of times.

      This is usually caused by PHP running as the apache user (mod_php or CGI) rather than the user that owns your WordPress files (suPHP or FastCGI). Switching over to using suPHP or FastCGI can fix it but the one you posted is a easier way :)

      Thanks for sharing

  2. Thanks for this. I wish I’d seen it about a month back; I had two mysteriously corrupted .htaccess files in two weeks. Great to know there’s an even easier way to handle them!

  3. Strange, I was trying to fix a 500 internal server error when migrating a site from my servers to my clients and it wasn’t working. Renamed and then deleted the .htaccess file, no fix. Then suddenly a couple of minutes later got this error: [an error occurred while processing this directive]

    How do I get around that one?!

  4. Hello @lolo_mono

    Thanks for your comments and the nice words. I see that your site is working fine. Do you have any issues with the site which relate to this article ?

  5. The major problem I have with wordpress is the total lack of personal customer service. The forum thing doesn’t work for me and thousands of others, I’m certain. If it doesn’t relate to your issue – any most times it doesn’t – then what?

    They had better change their ways or some younger, smarter geek will devise a better and more friendly way of doing business.

  6. This afternoon, my face very perplexing problems associated with error wordpress.
    Suddenly the message “Error Establishing A Database Connection”.
    I think there may be changes to the wp-config.php, but after I see no change from the initial setup (all in accordance with the settings).
    Not long after recovering my website, I am very happy.

    After a few minutes, I return an error page with the same message. The incidence of recurrent bebeberapa times on the same day.

    Maybe you can enlighten me what happened to my website

    Thank you

  7. Thank you so much for this! My wordpress blog had been giving me the white screen of death for quite sometime and I have searched for reasons, and somehow ran across this website. Turns out it was the WPcache plug in I had causing it all along. Once again thank you thank you!

Participate