, , ,

What, Why, and How: Common WordPress Errors and their Solutions

wordpress error

Literally, nothing is idiot proof, not in any case WordPress.

In spite of the considerable adaptability and heap of components that put whatever is left of the CMS swarm practically out of the opposition, WordPress sites are similarly as inclined to glitches and mistakes as anything.

But what makes WordPress special is the sheer amount of free help you can count on from the community. The Codex combined with support forums and millions of resources covering almost every possible aspect of WordPress will make sure that you’re not left on your own.

As part of my ongoing contribution to the growing list of WordPress resources, I have compiled a list of common WordPress errors, their causes, effects, and solutions for newbie web developers. So when faced with any of the following errors, which may seem like the end of the world, you can resolve it on your own in a matter of minutes.

1.Cannot modify header information

The Error:

When you visit your website URL, you get a message that starts with:

“Cannot modify header information – headers already sent by …”.

Why it happens:

The error essentially means that something else was sent before and after the actual header’s code could be processed. In this case, it’s most likely some errant characters or spaces, or maybe even a code snippet placed before or after the closing and opening tags in a WordPress script.

Solution:

Start by taking a closer look at the error message. It should look something like this:

Warning: Cannot modify header information – headers already sent by (output started at /path/blog/wp-config.php:76) in /path/blog/wp-login.php on line 43

The path within the brackets and the number at the end are the exact places of error. In this example, it’s line 76 of wp-config.php

Go to your WordPress installation directory and find the file that says ‘already sent the header information.’ Open it in a text editor like Notepad++.

Check line 76 and make sure there are characters, spaces, or code lines before tags<?php and after >? Save this file on your desktop: keep the name but change the ‘Encoding’ (you’ll see a box before the ‘Save’ button) to UTF-8.

Upload the file back to where you found it in WordPress directory via FTP.

Tip: Avoid this error in future by using JavaScript instead of the function for redirection purposes. wp_redirect()

2.White Screen of Death

The Error:

This one is so common that geeks abbreviated it ages ago (WSOD). And yet, it can still cause severe heart palpitations for anyone who’s confronted with the terrible, blank White Screen of Death

Basically, any time you try to visit any page of your WordPress website (even backend or admin), you’ll see a big fat blob of this:

WordPress Errors

Why it happens:

Most commonly, it happens because of WordPress plugin or theme compatibility issues.

Solution:

If you can still see the backend, login to your admin dashboard and deactivate all the plugins. Just every last one of them. After that, visit the site URL again.

Now activate your plugins one by one. After every plugin, you activate, refresh your browser window to see your website. The moment it breaks, you have found the culprit plugin. Contact the plugin and theme authors to discuss and resolve this issue.

If your backend is also compromised, deactivate the plugins via their files. Go to your WordPress installation directory in FTP and go to path:wp-content/plugins Rename the plugins directory to anything else to deactivate all the plugins. This will vanquish the WSOD — you can then move all plugins’ files to computer. Restore your directory namewp-content/plugins, and upload the plugins manually, one-by–one. Keep checking the front-end (browser window that displays your website) to keep track.

It’s tedious work. You just have to bear with it.

3.All posts display “404 Not Found” Error

The Error:

Anytime you visit your posts, you get this:

404 Not Found

The web server cannot find the file or script you asked for…which is baffling because you HAVE posts on your website and the stupid server should be able to find them.

Why it happens:

Common causes include anything from broken links to corrupted or deleted .htaccessfile.

Solution:

Let’s start with a simple and obvious-in-hindsight solution first.

Go to your WordPress admin >> Settings >> Permalinks. Choose another setting, hit save, and get back to your erstwhile setting. Now try visiting your posts again.

The above method fixes. .htaccess

If you still can’t see your posts, you’ll have to fix manually .htaccess as. For that, open your FTP client and access the WordPress directory. Look for the file in the same directory. /wp-includes

Now add this bit in your .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

Sometimes, it’s just a faulty URL. Before coming to the conclusion that something’s wrong, check other posts in various browsers.

4.HTTP 500 Internal Server Error

The Error:

You’ll see a message that looks something like this:

Internal Server Error

The server encountered an internal error or misconfiguration and was unable to complete your request…

Why it happens:

This particular error (and its fix) applies to all websites on the Internet. It can happen because of corrupted or in is.htaccess WordPress core files, compatibility issue (plugins or theme), exceeded memory limit, and more.

Solution:

1. .htaccess: Since a corrupted ‘set of direction is a new.htaccess file the most common cause, you can make a safe bet on this. Simply, find the file (as directed in 3 >> Solution) and cut it from the directory. Once you’ve done that already, revisit your website to see if the problem has been fixed. If the problem is fixed, go to your Admin >> Settings >> Permalinks and reconfigure the settings to automatically get the new file. .htaccess

2. Plugin/Theme Compatibility: Another common cause for this error. Make sure to deactivate all plugins and reactivate them one by one (as directed in #2 >> Solution). If none of the plugins caused this, then try switching to a default theme.

3. Allowed memory size exhausted: Can be another reason for internal server error. Increase PHP memory allocation.

4. WordPress core: Corrupted core files can be replaced by simply downloading WordPress again. Go to WordPress.org, download the latest version, and install it.

5.Execution Time

The Error:

This:

“Fatal Error: Maximum execution time of 30 seconds exceeded in /file-path.php on line 538.”

Why it happens:

Your server or script in question is taking too long to respond/process. Usually, the default execution time is 30 seconds, but it may vary depending on hosting provider.

Solution:

First, make sure you have a backup of your website content and database.

Now, there are three ways to fix this:

1. htaccess: Add the following code to this file to increase execution time to 60 seconds.

php_value max_execution_time 60

2. php.ini: You may need to ask your hosting provider for access to this file. Add the following:

max_execution_time = 60

3. Plugin: WP Maximum Execution Time Exceeded will let you set execution time to 60 seconds only.

0 replies

Leave a Reply

Want to join the discussion?
Feel free to contribute!

Leave a Reply

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