How to display error messages in WordPress seems to be one of the most common sort-after solutions by new WordPress users or web developers.
This is common when there is a problem with your WordPress website. Has your WordPress site suddenly gone blank and you have no idea what is wrong?
If this is the case, you don’t need to panic since today, I will begin to show you how to easily and quickly troubleshoot WordPress errors.
For most common WordPress errors like the White Screen of Death, if you are confident enough you may not need the help of a WordPress developer to fix it.
Using simple WordPress tips that you can freely get from YouTube and Google, you can easily fix the most common WordPress errors.
WordPress Display Error Message: Getting Started
The first step when fixing WordPress errors is to learn how you can display them and identify the location of the error.
Plugin errors commonly occur when there is a faulty plugin, a new code is added, an upgrade of the plugin or WordPress theme, and so on.
Displaying the errors is the first step towards solving them but having an idea on what caused the error can be a good place to begin. Some important questions that can help guide your WordPress troubleshooting are as follows :
- What is the last update you have done?
- Have you installed a new plugin?
- Have you added a new theme or added code in your existing theme?
- Has your hosting company changed anything lately?
If you can answer these questions you are in a good place to successfully start fixing the WordPress errors.
WordPress Display Error Message: Debug Mode ON
In the engine of your WordPress site lies a small file that plays a crucial role in connecting your WordPress site to the database and securing it. This file is named – wp-config.php.
This is where you set WordPress display error message and you can now see all the errors on your site and can link them to a specific plugin or line of code in your theme.
Open this file and look for the define(‘WP_DEBUG’, false); line by default it is set to false.
To turn the WordPress display error message ON; you need to replace the false with true and save the settings.
define(‘WP_DEBUG’, true);
When you set this to true you can now see all the errors in your WordPress site.
If you have a white screen of death error on your WordPress site, you should use your hosting c-panel to access the wp-config file or the FTP logins.
WordPress Development Error Message Display
If you are a WordPress plugin developer or WordPress theme developer, it is advisable (WordPress Coding Standards) that you always turn on the debug mode when you are developing a theme or a plugin since it will help you notice the errors that are in your code and you can fix them before you release the plugin or theme to the public.
WordPress Display Error Message: htaccess Edit
Another way to display errors in WordPress is by using the htaccess file. You just need to add the following code in the htaccess:
php_flag display_errors on
This works like the debug mode set to on and it will turn on the WordPress error message display.
Reading the Server Error Log
Another quick way to identify errors in your WordPress site is to check out the server error log. When you log in to your hosting account at the root of WordPress installation there is a file named error log as shown in the image below :
This is an important file that shows you how your site health is progressing with time. You can see the plugins causing errors and remove or upgrade them.
Final Thoughts
These are the basic ways you can use to display errors in WordPress and it is the best way to get started fixing WordPress errors since you can always know where to look. If you are having error problems in your WordPress site, you can always feel free to reach out and I will be glad to provide some professional help in fixing WordPress errors.
Joe is an experienced full-stack web developer with a decade of industry experience in the LAMP & MERN stacks, WordPress, WooCommerce, and JavaScript – (diverse portfolio). He has a passion for creating elegant and user-friendly solutions and thrives in collaborative environments. In his spare time, he enjoys exploring new tech trends, tinkering with new tools, and contributing to open-source projects. You can hire me here for your next project.
Similar Articles
- How to Disable Store WooCommerce
- How to Access WordPress Admin Dashboard or log in to your WordPress Dashboard
- How to Delete a Page In WordPress
- How to Delete a Category in WordPress
- How to Center Menu in WordPress » How to Center Navigation WordPress
- How to Check the WordPress Version
- How to Make a Second Blog on WordPress
- How to Change WooCommerce Checkout Error Messages
- How to Fix WordPress Admin Dashboard Is Not Displaying Properly & CSS Not Loading
- How to Make WordPress Site Look Good
- How to Hide Errors From Visitors WooCommerce
- How to Fix WooCommerce Unpaid Order Cancelled
- How to Fix WooCommerce Storefront Theme Internal 500 Server Error
- How to Add Select Field to Checkout WooCommerce
- How to Change Post Date Programmatically In WordPress
- How to Fix Uncaught TypeError: wp.template is not a function
Comments are closed.