Got a WordPress-based website or blog? Have you run into a trouble?

Disclosure:We receive compensation from companies whose products and services we feature. All links, coupons & recommendations on this website should be treated as paid advertisements.

WordPress, a robust blogging and content management platform, powers a significantly large number of websites and blogs on the Internet. Like any other script, this content management system can start malfunctioning due to errors in coding or website settings.

Here is a list of common errors that can occur with WordPress installations.

  1. Blank page instead of website
  2. Permalink URLs not working
  3. WordPress posts showing 404 error page
  4. Syntax error in theme or plugin code
  5. Error establishing database connection in WordPress
  6. Shortcode not working in WordPress
  7. Image upload error: “Upload: failed to write file to disk” error in WordPress
  8. WordPress showing 403 forbidden error
  9. Maximum execution time exceeded error in WordPress
  10. Internal server error in WordPress

Before we start discussing the common errors in WordPress, let’s know how to find out the error details causing trouble with your WordPress installation. Check the error log! In your WordPress website root folder (generally, public_html or www), you will find a file named error_logs. Open this file to see the latest errors logged by WordPress. It will help you find the cause of the error.

1) WordPress Showing Blank Page Instead of Website

If your WordPress website has stopped showing and you get a blank page, the reasons could be multiple. It is often referred to as the White Screen of Death by the WordPress community.

Causes of Error

  • Malfunctioning theme or plugin with code errors
  • Missing WordPress theme directory

Solution

  • Recently installed or updated themes or plugins? Roll-back the change.
  • If you can access the WordPress admin, start by changing the theme to the default one. If the problem persists, start deactivating the recently added or updated plugins. By changing the theme and deactivating the plugins, you can find the culprit. Get rid of that theme / plugin.
  • If you cannot access the WordPress admin, you will need to access the WordPress folder on your web server either via FTP (you can use Filezilla) or via your hosting control panel file manager. Delete the active theme (located in your website WordPress folder > wp-content > themes) to see if the error is resolved. If not, delete all the plugins (located in your website WordPress folder > wp-content > plugins).
  • If the error is caused by a missing theme folder, your issue will be resolved by simply logging into your WordPress website admin. As WordPress detects the missing theme, it changes the active theme to the default one. If your website does not have the default theme, you can change it to any existing theme.

2) Permalinks / Pretty URLs Not Working in WordPress

If your WordPress site does not show pretty URLs with proper slug, the reason could be related to the web server or your website .htaccess file directives.

Causes of Error

  • Server missing the mod_rewrite module for Apache
  • Missing/incomplete code in .htaccess file in the root WordPress directory

Solution

  • If your WordPress has stopped showing pretty URLs for certain post types or pages, the error is with the .htaccess file codes. Some themes and plugins fail to make the correct change in the .htaccess file to support the new pretty URLs. You can login to your WordPress admin and simply hit the save button in the permalink settings via WP Dashboard > Settings > Permalinks to reset the permalink settings.
  • If resetting the permalinks does not work, you can edit the .htaccess file manually. Add the following code in the file. Be cautious as editing the file can break other settings.
    # 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
  • Where the mod_rewrite module is missing from the server, you will have to install and activate the same. You can ask your web server administrator or your hosting provider to enable the same.

3) WordPress Posts Showing 404 Error Page

You get the 404 error for posts when the permalinks are not set properly. The instructions above should be useful.

Some themes and plugins create custom post types to extend the functionality of WordPress. For instance, a plugin could create a testimonials custom post types for easy management of such content.

If the page that are showing 404 error were custom post types, check if the same have been disabled due to change of theme / plugin. You will have to reactivate the missing theme or plugin to re-enable the custom post type.

4) Code / Syntax Error in Theme or Plugin

Among all the errors, this is the most easily detected error as WordPress will show you an error message with the exact nature of the issue. Such errors generally occur if you have edited the theme or plugin files.

You will receive an error message such as: Unexpected ( on line 9 of functions.php

It tells you about the error detected and the associated file where the error lies.

Solution

A syntax error is just a mistake in your code that needs to be fixed. You (or the theme/plugin developer) left a piece of code with incorrect syntax. Fix the error by correcting the PHP syntax code.

As WordPress has already informed you about the nature of error and its location, log in to the hosting control panel & open the necessary theme or plugin file for editing. You can also edit the code using FTP. Fix the error and save.

If you don’t know how to write PHP codes, you should not be editing the theme or plugin files. Simply, revert to the original code in the file, or change the theme, or deactivate the plugin.

5) Error Establishing Database Connection in WordPress

Straightforward problem!

Your database server is down or your database connection settings are wrong. You might have accidentally changed the database username / password, or deleted the database if the server is functioning properly.

Solution

  • When the database server (MySQL or whatever is being used) is not working, you will need to get the database server up and running. Generally, the issue occurs when the database server is shut down. It can be due to a scheduled server maintenance or issue. Check with your hosting provider. They should be able to start the server or tell you when the database server will be active. Nothing to do beyond getting the database server active again.
  • If your database server is functioning properly, check the database connection settings in your wp-config.php file, which is located in the main / root folder of your WordPress installation. Check if the database, database user and database user password are the same in the configurations file as defined in your web hosting. If not, update the database credentials in your WordPress config file. Access and edit the wp-config.php file using hosting file manager or FTP.

6) Shortcode Not Working

If your WordPress page/post content has stopped displaying shortcodes and instead showing the text of the shortcode, such as [example], your theme or plugin that controlled the shortcode is inactive or changed.

Try activating the plugin or the theme in user when the shortcode was functioning properly.

7) Image Upload Error: “Upload: failed to write file to disk” in WordPress

Not able to upload images to your WordPress blog? Getting an error message: “Upload: failed to write file to disk” when you try to upload images and files using the media manager?

Some of the problems with images & uploads could be as:

  1. Images no longer showing on your website
  2. Unable to upload media files to your site
  3. Images are displayed as broken
  4. Media library not displaying properly (missing thumbnails)

Cause of Error

Such an error is basically due to incorrect folder permission in your web server. The uploads folder associated with WordPress is not correctly set, with permissions not being granted to write the file in the folder. You will have to fix the folder permissions and allow WordPress to write and read the folder content and files.

Solution

  • You need to change the folder read-write permissions for the uploads folder of your WordPress installation.
  • Unless you have changed the default upload folder settings, WordPress uses the following folder for saving all your uploaded files & images: Website Root Folder > wp-content > uploads.
  • Using the file manager in your hosting or FTP client such as Filezilla (recommended as its easier to make the changes in one go), you can change the uploads folder permissions.
  • Browse to the main website root folder, then go to the wp-content folder.
  • Now, select the uploads folder, and change the permissions to enable owner & group to read, write & execute the folder and its content files. In numeric notation, the uploads folder permission should be set to 755 or 775, never 777.
  • If yo are using Filezilla, select the uploads folder and right-click. You will get the menu, with the file attributes option listed in it. Click on it to open the dialog box for changing the folder permissions.
  • Enter 755 in number option box or select the checkboxes to get the right permission level, and select the “Recursive into subdirectories” option. You should then select the “Apply to directories only” radio. Update.
  • Alternative: For a quick and dirty fix, you can select the “Apply to all files and directories” radio in the above process. It will fix your problem instantly, but this is not the ideal setting. Files and images should have the permission set as 644, which means the execute option is not allowed.
  • If you have not used the dirty fix or enabling 755 for all files & folders recursively, you will now have to change the permissions of files contained within the folders, one folder at a time. For files in the folders, the right permission is 644. Select all files in the uploads folder and sub-folders, right-click to select-open the file attributes option. Now, set the access permission to 644. You will have to repeat the process for all sub-folders.

8) WordPress Showing 403 Forbidden Error

If you see 403 forbidden error message on loading your website, the issue is with the folder & file permissions. Follow the solution provided to fix the image upload issue. You will have to change the folder permission for the root folder of the website to 755. Check that the files are also accessible. The permission for files within the folder and sub-folders should be 644.

9) Maximum Execution Time Exceeded Error in WordPress

Simply put, your web server is not able to handle the process requested by the website within the time allowed by the server. You can optimize the script, or remove the plugin or theme causing the error, or increase the maximum execution time allowed for each script in your server.

Solution

Editing .htaccess File: Connect to your website using an FTP client such as Filezilla. The .htaccess file is located in the main root folder (generally, public_html or www), which also contains folders /wp-content/ and /wp-admin/. Open the file to edit, and add the following line to your .htaccess file.

php_value max_execution_time 300

The above code sets the maximum execution time to 300 seconds, which is enough to resolve your issue. If you still get the error, try increasing the value.

10) Internal Server Error in WordPress

An internal server error is not WordPress-specific error. It’s a generic error message common to all websites, and can be caused by several reasons. You can read about the errors here on WordPress Codex.

Such internal server error is generally due to a corrupt or invalid .htaccess file. Any misconfiguration in this hidden file located in the root folder of your website can cause errors.

Solution

  • For .htaccess error, log in to your website root folder using FTP / file manager. Make sure that the hidden file is visible. Rename your .htaccess file to .htaccess_old (or anything). Now, try loading your website. If your website is now up, you need to regenerate your .htaccess file for proper functioning for permalinks. Visit Dashboard> Settings > Permalinks and reset your permalinks by clicking on the save button. Done!