This website uses cookies

Our website, platform and/or any sub domains use cookies to understand how you use our services, and to improve both your experience and our marketing relevance.

A Detailed Guide on Troubleshooting Common WordPress Errors

Updated on May 19, 2022

13 Min Read
wordpress errors

Let’s take some time out and talk about common WordPress website hosting errors. WordPress is easy to use, but some of the most common WordPress issues can be a bit agonizing.

In this article, I am going to show you how you can fix the common WordPress issues.

So let’s begin,

Note:  The initial step is a complete backup of the site. This is a crucial step that shouldn’t be ignored. The backup guarantees that in the case of a disaster, the website could be restored without any issues.

WordPress White Screen of Death

One beautiful morning, you wake up, take some coffee, and sit at your workstation. You turn on your laptop screen, open up your browser, and enter your website’s URL. Shockingly, you encounter a blank page! No matter how many times you refresh, you’re unable to access the site.

White screen of death

For those of you who have never encountered the WordPress white screen of death, then you’re one of the lucky ones. In this section, I am going to show you how to fix the WordPress white screen of death.

Increasing the Memory Limit

The web host and WordPress sets PHP memory limits. At the point when the memory begins to run low, the server frequently shows a White Screen of Death. This issue could be resolved by increasing the memory limit.

There are various ways of increasing PHP memory limit.

  • Through Functions.php
  • Through .htaccess File
  • Through wp-Config.php

Functions.php

You need to go to the root directory and then to the folder of the current theme. For example, check the image below:
/public_html/wp-content/themes/twentysixteen/function.php

Function file

Download the function.php file on your local server and add the following code at the top of the file.

@ini_set(‘upload_max_size’ , ’64M’);
@ini_set(‘post_max_size’, ’64M’);
@ini_set(‘max_execution_time’, ‘300’);

.htaccess File

The second step is to edit the .htaccess file, it is located in the primary WP folders such as wp-content, wp-admin folder.

Htaccess file

Download the .htaccess file on your local server and add the following code and then re-upload it.

Here’s the code below:

php_value upload_max_filesize 64M
php_value post_max_size 64M

wp-Config.php

The third step is to edit the wp-Config.php file that is located in the root directory. Download wp-config.php and include the following code in it.

Here’s the code below:

define(‘WP_MEMORY_LIMIT’, ’64M’);
ini_set(‘post_max_size’, ’64M’);
ini_set(‘upload_max_filesize’, ’64M’);

WP Config File

Directly from the Platform

If you are a Cloudways user, then you don’t need to work hard. Cloudways have a built-in feature to change the file size limit. Here is how you can do it directly from the platform.

Login to your account and go to Servers from the bar on the top and get into your desired server. Navigate to Settings & Packages from the left side panel and you’ll see Upload Size under the essential settings tab. Change it in accordance to your requirement. For our situation, we are going to utilize 25MB.

increase-filesize-limit-in-wordpress-on-cloudways

Deactivate All Plugins

If the memory limit troubleshooting doesn’t fix the issue, then you need to try deactivating all your plugins. There is a probability that a conflict between your currently active theme and the module you just installed arises. In such a case, you could disable that particular plugin and everything should work just fine. Get to the admin dashboard of the WordPress website and go to the Plugins >> Installed Plugins.

Plugins

Deactivate the plugins one by one and refresh your site after each deactivation. If the site starts working correctly, then the error is in the plugin. Now, activate each plugin one by one and refresh your website again after each plugin activation. The plugin creating problems will soon be identified.

Deactivate all plugins

Replace Theme with a Default Theme

If troubleshooting the plugin doesn’t fix the issue, then don’t worry you should move to the next step. In this step, you should try replacing your current theme with a default twenty sixteen theme. The ideal approach to do this is by backing up your theme folder and then deleting the theme. This way WordPress will automatically fall back to the default theme and your error will be automatically fixed if it is a theme related issue.

Other Fixes

If none of the above fixes are worthwhile, then you need to reinstall a fresh version of WordPress. Also, you can use the debugging function if you want to see what type of errors are being displayed as output.

Add the below code in your wp-config.php file.

error_reporting(E_ALL); ini_set('display_errors', 1);
define( 'WP_DEBUG', true);
define( 'WP_DEBUG', true);

WP Config File

Once it is done, you should be able to increase PHP memory limits in WordPress without any problem!

WordPress Login Page Refreshing and Redirecting Issue

The WordPress login page refreshing and the redirecting issue is mysterious, but it’s an easy fix. It will take a short troubleshooting on your part; however, we’ll try to break things down and make them as simple as possible.

Login Page Refreshing and Redirecting Issue

Clear Cookies to Resolve Login Issues

WordPress scripts utilize cookies from your program for security purposes. It confirms your login data, but these cookies can cause multiple issues at times, including redirecting you back to the login page.

In order to fix it, clear your browser cookies and cache.

Cookies and Cache

After doing that restart your program and then try to log into your account. This should fix the problem for most of you.

Deactivate All Plugins

Already mentioned as above.

Check Your Theme

Already mentioned as above.

Delete .htaccess File Code

If clearing the browsing data to Resolve Login Issues doesn’t fix the problem then you need to try Delete .htaccess File Code. In some cases .htaccess file can get corrupted which can result in internal server errors or login page refreshing error. You just need to access your website through FTP.

Go to FileZilla and then add the following details.

  • Host
  • Username
  • Password
  • Port

FileZilla

Then go to your application and then delete code in .htaccess file from your website root directory. Now you might need to log back in again. If you succeed, then this means your .htaccess file was stopping you from logging into WordPress. When you are signed in, just go to Settings » Permalinks and click Save. This will generate a new .htaccess file.

Permalinks

Update Site URL

If the delete .htaccess File Code solution doesn’t fix the issue then you need to try Updating your Site URL. Sometimes, the issue may occur because of broken site URL. To dispose of this issue, you should update the URL of your site. Include these two lines of code in your “wp-config.php” file and keep in mind to replace the “example.com” with your own particular URL. Hopefully, the WordPress login redirect issue would be tackled.

The code that you need to put is:

define('WP_HOME','http://example.com');
define('WP_SITEURL','http://example.com');

Once it is done, you should be able to resolve WordPress Login Page Refreshing and Redirecting Issue to WordPress without any problem!

WordPress Keeps Logging Out Problem

If you utilize WordPress for an extended period of time, you probably have encountered the logging out the issue for at least one time. To be honest, this can be seen as one of the most frustrating issues, particularly when you are saving a vital setting. It is also known as the session timeout issue and this issue happens for a various number of reasons. A few reasons are listed below,

Incorrect Setting

You need to see the below image, the WordPress URL and the Site Address are two different URLs (see one has www. whereas, the other doesn’t).

Incorrect Setting

Correct Setting

If you want to fix this login issue, you need to make sure that you have the same URL as your site address and WordPress field as in the WordPress settings option.

Correct Setting

FTP Configuration

If you can’t access the admin area, then the second option that you can do is add a snippet code to the wp-config.php file. Connect your website through FTP and locate the wp-config.php file in your site’s root directory. You need to download this file on your local server and open it in a text editor like Dreamweaver or Notepad. Copy the below code in your wp-config file.

define('WP_HOME','http://www.example.com');
define('WP_SITEURL','http://www.example.com');

Make sure to replace the example.com with your own domain name.

Once done, you can save the file and re-upload it to your website’s root directory.

Fixing WordPress Image Upload Issues

If you find broken images in your WordPress Media Library and you can’t upload images, then there could be an issue with the file permissions of your Uploads directory.

Image Upload Issues

How to Manually Set Your File Permissions

Just go to your website’s directory using an FTP client, like FileZilla. You’ll need to go to the /wp-content/ directory. There you will see /uploads/ folder. Simply, right click on the uploads directory and select file permissions.

image13

After clicking the file permission, a new dialog box for file permissions will open up.

image06

Change the permission 744 to 755 if it didn’t work for you before. Then press the OK button.

Also, you should check the box next to “Recurse into subdirectories” and select the “Apply to directories only” radio button. Then press the OK button.

image12

Once it is done, you should be able to upload images to WordPress without any problem!

Directly From The Platform

If you are a Cloudways user you can easily set the permission just by 1-click. See the link below to read a complete guide on how to reset permissions.

How to reset the permissions of your application

500 Internal Server Error

500 Internal Server Error

All website operators, not just WordPress, may encounter the “500 error”. Fortunately, in most cases, the cause is found quickly. With WordPress, plugin and/or theme problems often result in server errors. Other possible causes of internal WordPress server errors are corrupted .htaccess files or insufficient PHP memory. Internal server errors can also affect the WordPress admin page, while the rest of the site works well.

Fix 1: Corrupt .htaccess File

The most common cause of error 500 is from the corrupted .htaccess file. This is the reason why you should check this file first as soon as this kind of message is displayed. Connect to your server via FTP access. Navigate to the root directory of WordPress and locate the .htaccess file. Give another temporary name to this file. Refresh your website again. It works? Congratulations! Now create a new .htaccess file by simply navigating to Permalink Settings in your WordPress Admin Panel and save the settings again.

Fix 2: Insufficient PHP Memory

Sometimes, the limit of PHP memory causes the error 500. To determine if it is the cause, you must check the error_log of your website. Enable the wp_debug mode and check the error protocols. Open the wp-config.php file and look for the following line of code.

Define ('WP_DEBUG', false);

And modify it as follows:

Define ('WP_DEBUG', true);

It is recommended to disable plugins and themes one after the other since an internal server error can also be caused by a plugin or theme. An increase in memory limit capacity can also solve the problem.

Fix 3: The Core Is Damaged

This is not common, but occasionally, the WordPress kernel may be corrupted and cause an internal server error. In such a situation, you must download a new set of kernel files to eliminate the source of the error.

Log into your website via FTP access and create a new wp-admin and wp-include folder. Changes in these folders should not affect your WordPress customizations unless you have saved modified files in these folders, but this is usually not the case. The files in the wp-content folder contain your theme, plugins, and other changes. You do not have to renew this folder, otherwise, the content of your site will be deleted.

If all else fails, you will need to download a new copy of WordPress from the official website and reinstall it completely.

Error Establishing Database Connection

Taskbar Appears Under the Main Content

If you are an experienced WordPress user, then common this WordPress error will probably be corrected quickly. However, for beginners, the message  “Error Establishing Database Connection” can be confusing.

The error occurs, for example, when you install WordPress manually or when you try to download your own website. Of course, a good WordPress web host needs to configure everything for you and make sure this error never happens. However, if you manage WordPress completely alone, this error can occur quickly.

Of all the WordPress-PHP files, the most important is wp-config.php because, without this file, no connection to the database is possible and your site will not work anymore. In this file, you specify your login information such as the database name, username, password, and host. This file is not editable for paying guests. It is therefore unlikely that the following scenario will be relevant to you if you are using a managed hosting service.

Fix 1: Incorrect Connection Settings

If a WordPress error occurs while establishing a connection to a database, this is usually due to incorrect connection settings in wp-config.php. If you are moving a website from a former hosting company, you will need to make a change. Update the name and password of the database in your wp-config.php, so your database works properly.

// ** MySQL settings - You can get this info from your web host ** //

/** The name of the database for WordPress */

define( 'DB_NAME', 'database_name_here' );



/** MySQL database username */

define( 'DB_USER', 'username_here' );



/** MySQL database password */

define( 'DB_PASSWORD', 'password_here' );



/** MySQL hostname */

define( 'DB_HOST', 'localhost' );

Fix 2: Wrong wp-config.php file

You forgot to update your wp-config.php file when you changed the password for the database.

You should update your password more frequently to secure your database. Remember, however, that you must change the password in your hosting control panel and in the wp-config.php file. Upload your wp-config.php file, open a text editor and edit the following line:

Define ('DB_PASSWORD', 'enter the password here');

Enter your new password, save the file wp-config.php and download it via FTP. Reload the browser and make sure your site is loaded.

Fix 3: Problems with DB_HOST

Once you have updated your wp.config.php to access your database from your new host, you may need to change the DB_HOST value (the database host).

This WordPress error is less common, but it can occur. Some hosting provider uses their own values when setting the database host parameter in wp-config. This is not always the case, however. Other hosts define a URL to the MySQL database server, which must be used as the value for the host of the database. Sometimes this also works if you insert the IP hosting address instead of a MySQL URL.

Fix 4: Error When Moving Your WordPress Site

Another common source of error is the transfer of your WordPress files to a new host. The website is always displayed at the beginning when you access the URL. However, once your former host has terminated your contract, if you have not transferred your database to your new provider’s server, your site will no longer be displayed. You receive the error message WordPress “Error Establishing Database Connection”.

The best way to avoid this failure is to immediately transfer the entire database to your new host. Update your wp-config.php file to access the new database. In this way, it is possible to safely cancel your old hosting account without losing any data and be confronted with the dreaded WordPress error message “Error Establishing Database Connection”.

Before you begin troubleshooting, make sure you have a backup copy in your database by exporting your MySQL file.

Taskbar Appears Under the Main Content

If this common WordPress error occurs, your sidebar will no longer be left or right of the main content but under your text. This is not only unattractive but can also affect the use of the website. Even though your layout may seem unnecessary because of this error, it does not mean that you cannot use your theme anymore. The error of the sidebar can often be corrected quickly.

A common cause of this error is too many open tags or too many closed div tags in your HTML. The div tags look like this in the code of your WordPress page:

<div> </ div>

This marking opens or closes HTML elements of your website. If a div tag is too little used in the code, it will not be implemented correctly. This mainly concerns the layout. When the problem appears only on a passage or a page, it is then very likely that the div tags are the cause. The easiest way to check for div tag errors in your code is to use an online HTML validator.

It is also possible that an error has crept into your CSS style sheet. You should consider this possibility if you have recently made any changes to this file. If you’ve assigned size specifications to the main content and sidebar that do not match each other, CSS cannot build your layout properly. Incorrect indications or too much padding can also lead to a misrepresentation of your website.

Another possibility is to disable the float property of your sidebar so that it is no longer aligned to the left or right through the CSS. Also, check the float definition to exclude this source of error.

Syntax Error

Syntax Error

Even a small typo error in the wrong place can cause the shutdown of your entire WordPress page. However, the message “Syntax Error” is not an insoluble problem.

A syntax error is, as a rule, caused by a small critical error in the syntax of your code. A missing comma or parenthesis interrupts the entire script. Have you recently installed a snippet or updated a plugin? If this is the case, then you should check that first.

To resolve WordPress syntax errors, you must rework the part of the code that caused this error. Either you delete it completely, or you correct the syntax. As a beginner, it is not uncommon to be quickly frustrated when a single mistake makes the entire site inaccessible. If you have added the code to your WordPress dashboard via the editor area, it is no longer possible to directly access your WordPress code. The only possible way to resolve the syntax error is to directly exchange the faulty code via FTP.

Log in with your FTP program and change to the directory containing the theme file that needs to be reworked. The error code indicates the file and line concerned.

Either completely remove the newly added code or correct the syntax. Once you have deleted or reworked the code, save the file and download it to your server. Then launch the address of your website without cache, it normally works properly again.

Final Words

That is all there is to it. I hope that one of the tricks above may fix the issue you are observing with your WordPress website. I hope this tutorial proved to be of considerable help. If you have any query or suggestion regarding this tutorial, you can leave a comment below!

Share your opinion in the comment section. COMMENT NOW

Share This Article

Customer Review at

“Beautifully optimized hosting for WordPress and Magento”

Arda Burak [Agency Owner]

Saud Razzak

Saud is the WordPress Community Manager at Cloudways - A Managed WooCommerce Hosting Platform. Saud is responsible for creating buzz, spread knowledge, and educate the people about WordPress in the Community around the globe. In his free time, he likes to play cricket and learn new things on the Internet. You can email him at [email protected]

×

Get Our Newsletter
Be the first to get the latest updates and tutorials.

Thankyou for Subscribing Us!

×

Webinar: How to Get 100% Scores on Core Web Vitals

Join Joe Williams & Aleksandar Savkovic on 29th of March, 2021.

Do you like what you read?

Get the Latest Updates

Share Your Feedback

Please insert Content

Thank you for your feedback!

Do you like what you read?

Get the Latest Updates

Share Your Feedback

Please insert Content

Thank you for your feedback!

Unleash The Cloud.
Not Budgets.

For 4 Months +
Up To 30 Free Migrations

Cyber Week

SAVINGS
Time Left In Offer
  • 0

    Days

  • 0

    Hours

  • 0

    Minutes

  • 0

    Seconds

40% OFF

On All Plans

GET THE DEAL NOW