
WordPress is a popular Content Management System (CMS) that lets you build websites, portfolios, and eCommerce applications. While it’s a user friendly platform, there are common WordPress errors that make it a hard platform to troubleshoot depending on the amount of errors displayed to either the site visitor or administrator dashboard.
Depending on the error source, most WordPress errors are a result of the underlying infrastructure that functions to deliver your application to the site visitors. In this case, if your web server configuration breaks, your WordPress site automatically shows an error to the site visitors, fix it by troubleshooting the web server functionalities.
Frontend WordPress errors are minimal warnings that don’t usually break your site structure, but greatly impact the user experience each time your site loads to a new visitor. In this case, you should scan common plugin, WordPress core, and theme errors to avoid any additional errors.
This article explains common backend and frontend WordPress errors and how you can troubleshoot them to improve your site's reliability.
Before you begin, make sure you:
Have an active WordPress site. If not, deploy a OneClick WordPress server using the Vultr Marketplace application
Log in to your WordPress site as an administrative user
Have SSH or terminal access to the WordPress server
Many WordPress errors get discovered each time a new major update rolls out. Depending on your exact error, below are 10 of the most common WordPress errors known to affect site performance, search rankings, reliability, and sometimes lead to total data loss.
To troubleshoot and fix common WordPress errors, you must know the exact source of the error before you take steps to find a solution. Commonly, you should follow the basic troubleshooting steps described in this section to fix WordPress errors.
WordPress logging allows you to view errors in a single output file. By default, the feature is inactive, enable it to keep track of any WordPress debugging errors that may display and affect your site performance as described below.
Navigate to your WordPress web root directory. For example /var/www/html, /var/www/public_html, /var/www/example.com/
Using a text editor of your choice such as nano, edit the wp-config.php file
Add the following directive at the end of the file to activate WordPress logging
Save and close the file
Switch to the wp-content directory
List files and verify that a new debug.log file is available in the directory
View the debug.log file to access the WordPress error logs
Each time your WordPress site runs into an error. It’s logged to the debug.log file. Always view the file to identify the exact source of the error. For example:
The above error shows that your custom-plugin returns an error on line 644. You can edit the plugin file to correct it, or disable the plugin to prevent any additional errors.
WordPress debugging enables the display of errors on your WordPress site for troubleshooting by an administrator. Usually, these appear when any of the installed themes or plugins are poorly coded or returns runtime errors. By default, WordPress debugging is not active, enable it as described in the steps below.
Edit the wp-config.php file
Add the following directives at the end of the file
Save and close the file
The above directives turn on WordPress debugging and disable errors from appearing on your site visitor's screen. This allows you to know the exact source of a WordPress error and gives you enough details to correct it and avoid any additional errors in your application.
The web server is the root component of your WordPress site that keeps it running. Most WordPress deployments either use Apache, Nginx, OpenLiteSpeed, or Caddy as the web server application. Depending on your deployment, check the web server logs to identify the source of a WordPress error as described in the steps below.
Visit the /var/log/ directory
Switch to the web server logs directory. For example Nginx
View the error log
If your WordPress configuration uses a custom Nginx error log such as example.com.error.log, view the file contents to display the application's specific error.
If your WordPress site has a web server-related error. It should display in your log file entries
The above error shows that the web server displays a 404 error because the productabc.html file is unreadable or unavailable in the WordPress web root directory.
WordPress recovery mode allows you to troubleshoot errors by granting you temporary access to the administrator dashboard until all issues get resolved. Usually, when a critical error occurs, the site administrator receives a recovery link through which you can access the WordPress dashboard. In case you don’t receive any WordPress email, enable recovery mode as described in the steps below.
Use the WordPress recovery link
When prompted, enter your WordPress administrator username and password to access recovery mode.
In recovery mode, navigate to Tools on the main navigation menu.
Click Site Health from the drop-down list
View the present WordPress issues on the Status page
Fix each of the WordPress issues to avoid any additional errors, and verify that your Status changes to Good
The establishing a database connection error is common and displays when WordPress is unable to write to the database using the user and password in your wp-config.php file. Usually, the database server can run into an error, or your user can't write to the WordPress database. Fix this error as described in the steps below.
Verify that the database server is up and running
Output:
If the Database server status is Inactive (Failed). Restart it to access all databases
Verify that it runs correctly with any errors. If not, view the database logs to establish the source of the error
Output:
As displayed in the above output, the MySQL database server is unable to start due to low server memory, and conflicts with another application on port 3306.
Verify the contents of your wp-config.php file
Output:
Verify that the database name, user, and password match with actual records on your MySQL database server. Also, take note of the $table_prefix = directive that should match your database naming style. To test your user access, log in to the MySQL database server.
When prompted, enter your password
View the available databases, and verify that the WordPress database displays on the list
Switch to the database
View the database tables and verify that the naming prefix matches your $table_prefix = value in the wp-config.php file
Output:
As displayed in the output, wp is the WordPress table prefix that should appear in your wp-config.php file
When your WordPress server runs with an invalid SSL certificate, an Insecure Connection or Your Connection is not Private web browser error displays to every site visitor before your site loads. To correct this error, verify that your web server points to the correct SSL certificates. When using a free Let's Encrypt certificate, use the Certbot tool to renew or re-generate SSL certificates for your domain as described below.
Navigate to the web server virtual host files directory. For example /etc/nginx/sites-enabled
View your WordPress host configuration file
When running multiple WordPress sites on the same web server, use the following command to identify your target configuration file. Replace example.com with your actual domain name
Verify that the ssl_certificate and ssl_certificate_key directives point to the /etc/letsencrypt/live/ directory
Using the certbot client tool, generate a new SSL certificate for your WordPress site. Replace example.com with your actual domain name.
Verify that the certificate issuance process is successful
Test that the certificate auto-renews upon expiry
Output:
When successful, Certbot automatically renews your WordPress SSL certificate every 90 days.
In your web browser, visit your WordPress site to test HTTPS access, and verify that the Invalid SSL certificate error no longer displays to site visitors
To implement different types of SSL certificates, visit the following resources:
The WordPress 503 Service unavailable error is commonly a result of resource limitations on your server. Usually, when your WordPress server hits your maximum allowed Bandwidth volume, the error displays as data requests do not complete successfully. Also, it can result from poorly coded plugins or theme files, fix the error as displayed in the steps below.
Log in to your WordPress server control panel, and verify your server has enough allocated bandwidth
Depending on your hosting provider, unlimited bandwidth may display in your control panel, but when it's indirectly limited. If you identify bandwidth caps, migrate to a predictable pricing provider such as Vultr to scale your server to your needs
View your web server error logs and verify error source
Verify that PHP-FPM is running correctly on your server to handle PHP scripts
Depending on your PHP version, you can rename to view the FPM status. For example php8.1-fpm
If the error persists, navigate to your wp-content directory
Rename the directory to plugins_old
Recreate the plugins directory and verify if the error gets resolved. If not, investigate the status of server infrastructure, web server, and WordPress error logs to find the exact source of the error.
The HTTP 404 error displays when the web server is unable to find a requested resource on the server. For example, when the site visitor requests a file or page that's not available on the server, the web server returns the 404 error. Find and fix the error as described below.
Grant the web server ownership permissions to the WordPress web root directory
Set the correct directory and file permissions
755 directories:
644 on files:
Long list the web root directory and verify the available permission values
Output:
Revisit your WordPress site, verify that the requested resource is available on the server, and the error does not display again
View your WordPress web server configuration file
Verify that the configuration points to the WordPress web root directory
Depending on your web server, the web root directive may appear different. For example DocumentRoot when using Apache
Log in to your WordPress administrator dashboard
Navigate to Settings > Permalinks, reset your WordPress Permalinks structure to refresh your URL structure and avoid 404 errors
Verify that the web server is up and running
Verify that PHP-FPM is active and running
View the web server error logs to verify the exact source of the error
Also, view the PHP-FPM error logs to verify if the error is not caused by a PHP script
Output:
The HTTP 502 bad gateway error is results from a web server response time out. When a user makes a request to your WordPress site, the web server returns the 502 gateway error when it’s unable to handle the request. Usually, when the connection to PHP-FPM times out, the web server returns the error. Find the source of the error, and fix it as described below.
View the latest web server error log entries
Find the latest error. Usually, you may find the error *1 connect() to unix:/var/run/php-fpm.socket failed (2: No such file or directory) while connecting to upstream. To fix it, view your web server configuration
Verify that the correct PHP configurations are available in the /.php section
Verify that PHP-FPM (based on your version) is up and running
Output:
If the error persists, view the PHP-FPM configuration
Verify the user/group and verify that it runs as the web server user www-data
Visit your WordPress site and verify that the error does not appear again. When it does, view your web server error logs again to verify the source of the error.
HTTP 403 forbidden error displays due to improper permissions to access a specific resource on the WordPress server. Usually, if the web server does not have read privileges to a resource, the error displays on your WordPress site. Fix the error as described below.
View the web server error logs to find the exact source of the error
Long list the WordPress web root directory and verify that the www-data user has read privileges
Output:
Grant the www-data web server user full privileges to the directory
Set the correct WordPress directory permissions
Set the correct WordPress file permissions
Visit your WordPress site and verify that the error does not display again
When the web server is unable to write new files uploaded through your WordPress dashboard, the failed to write file to disk error displays. To fix the error, verify that the web server has read and write privileges to the WordPress web root directory. Verify the permissions as described below.
View the WordPress web root directory permissions
Set the correct directory permissions
Set the WordPress file permissions
When WordPress upgrades to the latest version, the site is experiencing technical difficulties error may display. This is because some themes or plugin files may be incompatible with the new upgrade, find the exact WordPress resource and fix the error as described below.
Rename the plugins directory to pluginsold
Create a new plugins directory
Visit your WordPress dashboard to activate the new plugins directory
In your terminal session, copy the old plugins one by one. For example, start with woocommerce if available
Depending on the number of available plugins, copy the most important plugins first, and the suspected plugins last
In your WordPress dashboard, reactivate the plugins one by one
If the error displays after activating a specific plugin, disable the plugin, and search for an updated version before reactivating it again.
In case the error is a result of a broken theme, verify that your active theme supports the latest WordPress version, if not, downgrade your WordPress to the most stable backed-up version
The WordPress white screen of death is a blank screen that displays no error, but does not accept any interactions on your WordPress site. Instead of a white screen, the error There has been a critical error on this website may display, both errors are the same and affect your general site performance. Usually, the error displays due to theme or plugin issues, and below are the recommended troubleshooting actions.
For more information, visit Troubleshooting the WordPress White Screen of Death.
In this article, you implemented troubleshooting steps to fix common WordPress errors on your site. Among these, you implemented backend server actions that allow you to discover errors and work on them before they appear to your WordPress site visitors. For more information, visit the WordPress common errors page.
0 Comments
Be the first to comment and share your perspective with the community.