6 Common WordPress Errors and How To Fix Them

7 minute read
0
6 Common WordPress Errors and How To Fix Them

WordPress is the most popular content management system in the world with a market share of 60%. Not only that, WordPress powers 35% of websites on the internet and 17% of top websites in the world. All these numbers don’t mean that it’s perfect.

In this article, you will learn about six common WordPress errors and how you can fix them.

1. White Screen of Death

Most of us are familiar with the blue screen of death as we grew up using Windows operating systems on our computers. Did you know there is also a white screen of death? It’s on WordPress and shares few characteristics from the blue screen of death.

Reasons (and Solutions) for the WordPress White Screen of Death

#1 Plugins

You recently found a useful plugin and decided to install it, or you updated or modified an old one. After that, you get a surprise WordPress fatal error, and the plugin is caught red-handed. Sometimes that sort of things can cause a conflict with your currently active theme, and the solution is simple – deactivate the plugin.

#2 Memory Limit

This issue is more often than not caused due to hosting limitations, and, as with other WordPress fixes, you can use FTP manager to restore it to former glory.

First you need to edit the wp-config.php file on your WordPress site. It is located in your WordPress site’s root folder, and you will need to use an FTP client or file manager in your web hosting control panel.

Next, you need to paste this code in wp-config.php file just before the line that says ‘That’s all, stop editing! Happy blogging.’

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

This code tells WordPress to increase the PHP memory limit to 256MB.

Once you are done, you need to save your changes and upload your wp-config.php file back to your server.

You can now visit your WordPress site and memory exhausted error should disappear now.

#3 Initiate Debugging

Okay, so you tried out both steps and white screen of death is still there. You know that plugins and memory limit are not causing the issue, so what is? It is time to enable the tough guy – debugging. He will expose any errors for you.

To enable debugging, open up your wp-config.php file. Among other lines, you should see the following:

define( ‘WP_DEBUG’, false )

All you have to do is to replace “false” with “true” (without quotation marks), and reload your site. Sometimes the mentioned line isn’t there. That shouldn’t worry you, just add it somewhere towards the top.

Instead of just the white blank screen, an error message will appear. How does that help? Well, if you haven’t disabled all plugins and themes, the error message will point out where is the problem. Specifically, it will show something like this:

Cannot redeclare get_posts() (previously declared in /var/www/html/wordpress/wp-includes/post.php:1874) in /var/www/html/wordpress/wp-content/plugins/test-seo-plugin/test-seo-plugin.php on line 24.

It means that the problem is in line 24 of “test-seo-plugin”, and disabling the plugin should fix the problem. If you know how to modify the code, you can fix it manually, and if not, you can write to the plugin author.

Honestly, it’s easier to disable it and wait for the developer to fix it.

Lastly, if there are no error messages after you enabled debugging, contact your host, because it means that debugging is not correctly configured on your server.

Hope it helps!

2. Database Connection Problems

There are instances when your WordPress website cannot connect with your database where all the content is stored. As a result, WordPress fail to serve content to your website visitors and displays this error. To fix this problem, you need to go to your WordPress dashboard and use the WordPress repair tool. This tool checks if your database is corrupt or not.

5 Easy Fixes for QuickError Establishing a Database Connection in WordPress:

  1. Check whether your database login credentials are correct (most common reason of the issue).
  2. Repair a corrupt database with WordPress’ built-in database repair mode: define(‘WP_ALLOW_REPAIR’, true);
  3. Fix corrupt files
  4. Check with your hosting provider for issues related to your database server
  5. Restore to your latest backup

3. Internal Server Errors

Internal server errors are usually caused by catchall error messages which indicates a problem with your server but there can be many different causes for it. Due to this, you should take a comprehensive approach to resolve this issue. Here are some things you can do to fix the internal server errors.

  1. Reload the web page. You can do that by selecting the refresh/reload button, pressing F5 or Ctrl+R, or trying the URL again from the address bar.
  2. Clear your browser’s cache
  3. Delete your browser’s cookies.
  4. Reupload wp-admin and other folders
  5. Increase memory limit
  6. Disable all your plugins
  7. Use default theme
  8. Fix your corrupted htaccess file

4. Parse and Syntax Errors

Parse and syntax errors occur when there is an error in your PHP code. This usually happens when you try to add code in your functions’ file, but it can also be caused by a plugin or theme in some cases. Your server will not only tell you the main reason behind this error, but it also indicates the code line number that is causing the problem, which makes your life easier.

In most cases, such errors occur soon after you have made some changes so you can easily fix this error by reverting those changes. If that is not the case, then you should establish a connection with a FTP and delete the line of code which is causing all the problems.

5. Connection Timed Out

This error mostly occurs due to poor shared hosting environments with low memory limits. That is you should choose a hosting provider like you choose a design company. If you have purchased a shared hosting and the server your website is hosted on fails to respond to all the requests, a connection timeout message will pop up on the user screen who will try to access your website.

Start off by deactivating all the plugins and reactivate your plugins one by one to identify which plugin is causing the problem. You can also consider switching hosting providers, get an upgraded plan or switch to a dedicated server.

6. 404 Error

A 404 error is an HTTP status code that means that the page you were trying to reach on a website couldn’t be found on their server.

To be clear, the 404 error indicates that while the server itself is reachable, the specific page showing the error is not.

  1. Retry the web page by pressing F5, clicking/tapping the refresh/reload button, or trying the URL from the address bar again.

The 404 Not Found error might appear for several reasons even though no real issue exists, so sometimes a simple refresh will often load the page you were looking for.

  1. Check for errors in the URL. Often times the 404 Not Found error appears because the URL was typed wrong or the link that was clicked on points to the wrong URL.
  2. Move up one directory level at a time in the URL until you find something.

For example, if www.web.com/a/b/c.htm gave you the 404 Not Found error, move up to www.web.com/a/b/. If you get nothing here (or an error), move up to www.web.com/a/. This should lead you toward what you’re looking for or at least confirm that it’s no longer available.

  1. Search for the page from a popular search engine. It’s possible that you simply have the entirely wrong URL in which case a quick Google or Bing search should get you where you want to go.

If you do find the page you were after, update your bookmark or favorite to avoid the HTTP 404 error in the future.

  1. Clear your browser’s cache and cookies.
  2. Change the DNS servers used by your computer, but usually only if an entire website is giving you a 404 error, especially if the website is available to those on other networks (e.g., your mobile phone network or a friend in another city).
  3. Contact the website directly. If they’ve removed the page you’re after then the 404 error is completely legitimate and they should be able to tell you that. If they’ve moved the page and are generating 404s instead of redirecting visitors to the new page, they’ll be happy to hear from you so they can go fix it.
  4. Finally, if all else fails, wait. No, it’s not fun, but it might be your only course of action, especially if you’re confident the 404 error shouldn’t be happening.
× Shopping Cart

Your cart is empty.