5/5 - (1 vote)

Image1

Experiencing WordPress errors is a common situation for many WordPress users. However, for most beginners, it can be quite scary to run into any WordPress issues if you don’t know how to fix them.

WordPress is undoubtedly the most popular content management system (CMS) with a lot of useful features and great security. But still, issues like WordPress errors and glitches are unavoidable, no matter how advanced it is.

Fret not. Most of the errors are repairable, meaning you can troubleshoot and solve them on your own.

In this article, you will learn about the top five WordPress errors, how to fix them, and prevent them from showing up again. So, let’s get started!

504 Gateway Timeout

Image2

The 504 Gateway error is a common error that occurs when a server that acts as a proxy or gateway does not acquire a well timed response from an upstream server. Thus, the request cannot be completed.

There are several issues that might cause the 504 Gateway Timeout error, such as connectivity problems, Domain Name System (DNS) problems, and an Unresolvable domain. If you are experiencing this 504 gateway error, here are three simple ways to fix it.

Clear Browser’s Cache

Clearing your browser’s cache is the easiest fix you can try. Depending on the browser’s preferences, here is an example of clearing cache using Google Chrome:

  1. Open Google Chrome.
  2. Navigate to Customize and Control -> Settings -> Privacy and Security.
  3. Select Clear Browsing Data.
  4. Check Cached Images and Files then hit Clear Data.
  5. Reload the website or press F5 to see if the error is fixed.

Flush DNS

Flushing DNS cache might solve an issue with incorrect DNS configuration, which can be the reason for the 504 gateway timeout error. Keep in mind that the method depends on the operating system you use.

The following steps are for Microsoft Windows:

  1. Open command prompt command (CMD) by pressing Windows+R keys simultaneously, then type cmd on the dialog box and press Enter.
  2. On the CMD window, type ipconfig /flushdns and hit Enter.
  3. There will be a confirmation message if you successfully clear or reset the DNS cache.

Reset the .htaccess File

Adding and removing plugins from WordPress will generate entries to the .htaccess file. However, it will slow down the server response time if the plugins are incompatible, which can lead to 504 gateway timeout error.

The easiest solution is to reset the .htaccess file to its original state. Here is how to do it:

  1. Access the file manager from your web host.
  2. Find the public_html folder then navigate to the .htaccess file.
  3. Make a copy of the file with a different name, such as .htaccess.backup.
  4. Open the original .htaccess file on the text editor and replace the existing code with the following:

# 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

5. Click Save to complete the process.
6. Test if the method works by reloading your website again.

Syntax Error

Syntax error is mostly caused by incompatible plugins or themes. However, finding the plugins or themes that cause the error can be a bit technical.

First, enable WordPress debugging to locate the error. Use the cPanel File Manager or File Transfer Protocol (FTP) client, such as Filezilla, one of the most used FTP clients.

Here are the steps to follow:

  1. Open the file manager and navigate to the public_html -> wp_config.php.
  2. Right-click the wp_config.php file and select edit. It will take you to the text editor.
  3. Add the following snippet before /* That’s all, stop editing! Happy publishing. */:
 

//This enables debugging.
define( 'WP_DEBUG', true );

 

Here is how it looks on the wp_config.php file.

Image3

4. Save the change.
5. Reload the website to identify the full path of the syntax error.

Say, a corrupted theme causes the error. To fix the error, you need to access a file manager again and navigate to the public_html -> wp-content -> themes folder. Select the theme that causes the error and open the index.php on the text editor.

For example, Twenty_Twenty_One theme is corrupted. Let’s take a look at the following code.

Image4

It seems the error is caused by a missing semicolon at the end of the get_footer function. Therefore, simply type a semicolon on the 38th line.

get_footer ();

Save the file and reload your website. Do not forget to disable the WordPress debugging once the problem is solved by removing the define( ‘WP_DEBUG’, true ); function.

Database Connection Error

Image5

There are several issues that can lead to a database connection error, such as a corrupted WordPress file, corrupted database, or incorrect login credentials. The easiest solution to fixing the error is to reinstall the WordPress core files.

However, if the problem persists, you can use the following method instead:

  1. Access your cPanel file manager or open your WordPress directory via an FTP client.
  2. Navigate to the wp-config.php file and open it using a text editor.
  3. Scroll down until you find a line that says /* That’s all, stop editing! Happy publishing. */
  4. Type the following snippet code above it and save the file.
define('WP_ALLOW_REPAIR', true);

Image6

5. Once completed, you will get access to WordPress’ database repair feature. Visit yourwebsite.com/wp-admin/maint/repair.php. Note that you need to rename yourwebsite.com with your own domain name. Then, you will see the following page.

Image7

6. Select one of the options above. Wait until the process is complete
7. Access your website again to see whether the error is solved. Do not forget to delete the define(‘WP_ALLOW_REPAIR’, true); function from the wp-config.php file.

White Screen of Death

After using WordPress for quite some time, you might experience a white screen of death error. When this error occurs, your site will only display a blank page. A white screen of death error can be caused by several reasons, like memory limit consumption, theme and plugin conflict, and server issues.

Solving the white screen of death error is quite easy. Follow the steps below to get rid of the error:

  1. Access your cPanel file manager.
  2. Find wp-config.php file inside the public_html folder.
  3. Open the wp-config.php file by right-clicking on it and select Edit.
  4. On the text editor window, navigate to the line that states /* That’s all, stop editing! Happy publishing. */.
  5. Add the following snippet code above it:
 define(‘WP_MEMORY_LIMIT’,’64m’);

Image8

6. Click Save to finish editing the file.
7. Reload your site to check if the error is fixed.

500 Internal Server Error

Running into a 500 internal server error is a common situation to most WordPress users. The error is likely caused by a plugin incompatibility and a memory limit.

Plugin Incompatibility

If installing a new plugin causes a 500 internal server error, the best way to fix it is to disable or remove the plugins that bring the error.

To do this, simply access your WordPress dashboard and go to Plugins. From there, deactivate all the plugins and begin to activate the plugins one by one. Reload your website to check if the problem is solved. If the website runs normally, keep the plugin active until you find the incompatible plugin.

Memory Limit

Running out of memory might be the culprit behind the 500 internal server error. Memory limit can lead to this error because installed plugins or scripts use up an amount of memory to work.

Thus, we recommend increasing the PHP limit by editing the .htaccess file and adding the following functions:

 php_value upload_max_filesize 128M
php_value post_max_size 128M
php_value max_execution_time 300
php_value max_input_time 300
php_value memory_limit 256M

After that, check whether the problem is solved by reloading your site.

Conclusion

Troubleshooting WordPress errors can sometimes be technical and demanding. If any errors are left unattended for too long, the search engines might unindex your website from search results, which will negatively impact its credibility and traffic.

Therefore, getting familiar with fixing these top five WordPress problems are necessary. Here is a recap of the errors:

  • 504 Gateway Timeout
  • Syntax Error
  • Database Connection Error
  • White Screen of Death
  • 500 Internal Server

Prevent these errors from appearing in the future by always maintaining your WordPress performance and security. Also, make sure to always update your WordPress to its latest version.

 

Leave a Reply

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

Summer Sale Get 50% OFF for your purchase on today! Coupon code: SUMMER2024 Redeem Now
Summer Sale Get 50% OFF for your purchase on today! Coupon code: SUMMER2024 Redeem Now