We all love WordPress, but sometimes it can drive us a bit crazy. While WordPress is really easy to use, everybody using WordPress has at least dealt once in their life with some of these common WordPress errors. If you are anything like us it can drive you quite crazy at the time the error is thrown in your face. It’s never fun.
But whenever WordPress decides to act up, don’t worry yourself too much, there is always a solution as you’re going to learn in this week’s post. Get ready to start focusing on building your company successful again, we are going to help you solve most common WordPress errors. Let’s start today with the first bunch!
Notice: Before trying to resolve any of the below errors, make sure to have a full backup of your WordPress site. If you don’t know how to do this, try contacting your hosting provider, they should be more than willing to help out!
#1 Internal Server Error
Our first error to focus on will be the “Internal Server Error”, or sometimes “500 Internal Server Error”. This error usually happens when there is something wrong, but unlike many common WordPress errors, the internal server error does not tell you what you need to fix. Because the server can’t tell you what is exactly wrong it is mostly for up to you to figure out what is actually wrong, this can be quite frustrating. We’ve compiled a list of several reasons though which can be the basis of this error:
- Corrupted .htaccess file
- Corrupted plugin functions
- Corrupted theme functions
- Corrupted WordPress base files
- Exhausted PHP memory limit
Corrupted .htaccess file
An internal server error is most times the result of a corrupted .htaccess file. Let’s start with that one first, login to your WordPress root directory via FTP and rename your .htaccess to something else (.htaccess.bak). Refresh your browser and see if this solves the problem. If the problem is solved, go to Settings > Permalinks and click on the save Changes button to reset your .htaccess file and the write rules.
If this is not solving your problem yet, maybe there is something wrong with one of your plugins.
Corrupted plugin functions
A plugin you just installed or updated could be causing this error as well. This is off course easy to identify because you just installed this plugin. Sometimes, however, an older plugin might be the reason of this error, or maybe even several plugins which are incompatible with each other. The only way to find out this error is by deactivating all the plugins. A potential problem with this: if you are seeing the internal server error, accessing the WordPress admin will probably not work too.
Deactivating all plugins, when not having access to the WordPress admin, is thankfully pretty easy. Fire up your FTP client again, go to the “/wp-content/“ directory. In this directory, you will a directory called “plugins”. If you rename this directory (for example plugins.bak) all your plugins will be deactivated. If you create a new plugins directory and move your plugins one by one from your backup directory to the new one, you can easily test which was the plugin causing the problems. Another way to deactivate all plugins (a bit more advanced) is by using a database client (for example PHPMyAdmin), from your WordPress database, check out the table “wp_options“. There is a value called “active_plugins”. If you empty this value all plugins are deactivated as well. Start by re-enabling them one by one to find the one causing the issue.
Corrupted theme functions
The problem still not solved? Maybe there is something wrong with your theme. Try switching to the default theme in the backend (twenty fourteen at this moment) and reload your website.
Corrupted WordPress base files
Hopefully by now you were able to resolve the error. Are you still having the same error? Try replacing your “wp-admin” and “wp-includes” directories with “clean” files from a freshly downloaded WordPress installation file. This can easily be done via FTP.
Exhausted PHP memory limit
Our final resort for this common error. If everything else failed, there might be something wrong with your web server. Time to get your hands dirty 😉 start up your favourite text editor and create a file called php.ini. The only thing that needs to be inside this file needs to be the following line:
Save this file and upload it (using FTP again) to the “/wp-admin/“ directory.
#2 Syntax Error in WordPress
This error usually occurs when you are trying to add code snippets into WordPress and have accidentally missed something or the code has incorrect syntax. This will result into a PHP parse error and you will see a notice like:
Parse error – syntax error, unexpected $end in /public_html/your_site/wp-content/themes/your-theme/functions.php on line 56
Many times, the syntax error is caused by some missing or unexpected character(s) in the file indicated by the error. Most of the time this is caused by someone less experienced (sorry) trying to edit the code in a theme or plugin but it could also happen when you’ve installed a new theme or plugin that contains the error.
Syntax error solutions:
Educate yourself on pasting code snippets into WordPress
We’ve all started out slowly and as a WordPress beginner you have a long learning curve to go, but no worries take your time. If you run into this error after adding code snippets into your WordPress website, you will need to learn how to properly paste code snippets into WordPress or you might cause the same problem in the future.
Fix the affected code
If this WordPress error happened after updating a plugin or pasting some code from the internet, you know exactly where to look :). The problem an error like this locks you out of your WordPress backend. You can however still login via FTP, navigate to the affected file and rewriting the code either by removing it or rewriting it correctly.
Try a different plugin or theme
If the error started after you activated a new plugin or theme, the logical thing would be that the error is located with the plugin or theme. The easiest way to fix this is, try a different plugin or theme, or maybe try to contact the developer of the plugin so they can fix the error. If you can’t deactivate the plugin or theme via the backend anymore (you are locked out of the backend), try removing the plugin or the theme via FTP.
#3 Auto-Update Failed
Ever since WordPress 3.7, WordPress introduced an auto-update feature. This auto-update feature takes care of security, minor bugs and things like that. Although the function is amazing and helps you keep up-to-date (prevents hacking), it sometimes fails. Because the auto-update works automatically (hence the name ;-)), this error probably happened at one point and you discover it later.
How to tell if the auto-update failed? There will probably be either a PHP error message, a blank white screen (also known as the White Screen Of Death – WSOD) or a warning stating that the update failed.
Fixing this error is easy though, just update your WordPress manually. If you don’t know where to start, please check out this Updating WordPress – Manual Update post at WordPress Codex.
#4 Error Establishing A Database Connection
Of all the common errors you might encounter over time, this one is the most self-explanatory. As you might have guessed, the error lets you know something broke the connection to your WordPress database.
Mostly an error like this has three root causes, an error in the “wp-config.php” file, there might be a problem with your hosting provider, or the most scary one; You’ve been hacked!
Edit your “wp-config.php” file
By now you should be familiar with the concept of FTP, try accessing your wp-config.php file in the root directory of your WordPress installation. Open up the file in your favourite editor and confirm that the database name, host, username and password are matching with those supplied by your poster. These should normally be almost at the top of the file, after editing be sure to save (and upload if necessary) the file.
Fix issues with your web hosting provider
If your “wp-config.php” file is all fine, but the error is still there, it’s time to start talking to your WordPress hosting provider. They will normally be able to tell you, whether their database server is experiencing problems or your database was shut down (for exceeding it’s quota for example). If they tell you everything is fine on their end, it might be that you are hacked..
Scan your website to determine if it’s compromised
There is always a possibility that you fall victim to a hackers attack, especially if you don’t know how to secure your WordPress. To make sure you website hasn’t been hacked, scan it using a tool like Sucuri Sitecheck. If Sucuri gives you the bad news, just stay calm and check out this article at the WordPress Codex, around what to do next.
To help prevent hacking in the first place, we recommend installing a couple of plugins like BruteProtect, Security Protection and Sucuri Security – Auditing, Malware Scanner and Hardening.
#5 Briefly Unavailable for Scheduled Maintenance Error in WordPress
Sometimes due to an unfinished or interrupted WordPress update, you might see Briefly Unavailable for Scheduled Maintenance error in WordPress. What happens there is that WordPress puts your site in maintenance mode during an update. If for some reason the update is interrupted, WordPress does not get the chance to put your site out of the maintenance mode. This error would lock down your entire site and make it unavailable for admins as well as visitors.
This error could be caused by two different things, the first one being, your WordPress update failed because some things are beyond your control and the other one being, the “.maintenance” file was not deleted after the update for one reason or another
How to fix this error?
We would recommend first checking if there is indeed an unwanted “.maintenance” file on your webserver. Login via FTP and check in your WordPress root directory and delete “.maintenance” file. There could be however also some update which went wrong, another way to solve this problem is to update your WordPress installation manually
#6 Sidebar Below Content Error
Sometimes this little error can cause some real headaches for people using WordPress. Although not as irritating as a complete unavailable website, you still want to be sure that your visitors can see your content in all it’s beautiful glory right? To be honest throughout our careers working with WordPress we had this one at least once before. Apparently this is a really common error and can easily be fixed too.
These errors are mostly cause by CSS errors (sometimes, you might accidentally use disproportionate widths that end up messing up your entire layout) or HTML errors (other times you might forget to close a few div elements)
So how do we fix these?
Fix your CSS
Improper width ratios will mess up your layout in turn placing your sidebar below the content area. You need to keep things in proportion. For example, if your main container is 960px in width, and your content is 600px, your sidebar is 300px, that only leaves you 60px for the margin in between. The other issue could be a floating property. You have to make sure that you add float: left; and float: right to the appropriate elements. If you do not do that, then it will not work. (or maybe you forgot to clear away your floats using a <div style=”clear:both”></div>)
Close all div elements
We have troubleshooted this issue lots of times. 9 times out of 10, the reason is the same. There is an unclosed div element on the page. It could also be that there is an extra div element being closed on the page which makes it seem like that your sidebar is outside the wrap element.
Be sure to ask yourself the question, Is this something that started happening recently? Is it only happening on a specific post or page? If your answer is YES, look through anything that you changed recently. Did you add a plugin? Made any HTML related changes? Does your specific post or page content has <div> blocks in them? Make sure that they are properly closed. The easiest way to find errors like these are to use a tool such as W3 Validator to check if your HTML code could be the cause of this error.
So that’s it for part 1, what are your most common WordPress errors? Let us know in the comments and we will try to answer them in part 2 of this blog post!