WordPress comes with multiple integrated debugging tools which can be used for troubleshooting issues, warnings, and errors on your WordPress website. Here are the exact tools available within WordPress that you can use for debugging various problems:
We advise that you do not enable debug mode with the WP_DEBUG_DISPLAY option on a live website as PHP notices, warnings, and errors may be displayed on the website to all visitors. This may allow bad actors to gather sensitive information or exploitable files in the WordPress installation. Using a staging instance is the recommended way to debug any issues with your WordPress installation. For more information on WordPress staging websites, please refer to our Creating and using WordPress staging sites article. |
These debugging tools can be enabled by:
There are also a lot of plugins available that can help you troubleshoot issues with your WordPress website. The most popular plugin for debugging a WordPress website is Query Monitor, which allows you to view various types of information about your WordPress installation like requests, scripts, and even queries.
Some additional information about debugging WordPress and dealing with the most common WordPress errors is available in our Fixing 404 error codes in WordPress and Fixing a WordPress blank page error (White Screen of Death) articles.
The easiest way to control the WordPress debug tools is by opening the management page for your WordPress installation via the hosting Control Panel > WordPress Manager and navigating to the Debugging section. Once there, select the checkboxes for the debug tools that you wish to use, and press the Save button.
Note: When you enable the WP_DEBUG option via the hosting Control Panel > WordPress Manager, the WP_DEBUG_DISPLAY option will be automatically enabled as well, so you can easily view the debug information in the HTML content of your website.
You can also manage the debugging tools for your WordPress installation using the Command Line Interface for WordPress (WP-CLI). WP-CLI is supported by default for all hosting accounts on our servers. You can find additional information about WP-CLI in our WP-CLI Tutorial.
Controlling the debug tools for a WordPress installation is very easy with WP-CLI. All you need to do is follow these steps:
The last method for managing the various debug options of WordPress is by manually editing the WordPress configuration file (wp-config.php). You can do this quickly via the hosting Control Panel > File Manager section by following these steps:
Once you have enabled the SAVEQUERIES debug tool in WordPress, you will need to use the $wpdb->queries global object to actually see the queries. The simplest way to do this is by adding the following code block to the footer PHP file of your theme (e.g. ~/www/www/wp-content/themes/twentytwentythree/patterns/footer-default.php if you use the Twenty Twenty-Three WordPress theme):
<?php
if ( current_user_can( 'administrator' ) ) {
global $wpdb;
echo "<pre>";
print_r( $wpdb->queries );
echo "</pre>";
}
?>
The code block will get the SAVEQUERIES debug information printed to all users with administrator access. You can add the code block right before the closing paragraph tag (</p>) using the hosting Control Panel > File Manager section.
No setup fees. Minimum contract period for shared hosting services - 12 months. Full prepayment for the contract period. 100-day money-back guarantee. No automatic renewal. Fees for domain registrations and SSL certificates cannot be refunded in case of an early contract termination.
ICDSoft 2001-2024 © All rights reserved
Terms of Use
|
Legal notice
|
Privacy
|
Reseller terms