The Complete Guide for WordPress Debugging (Enable WP_DEBUG and other tools)

In order to accomplish that, WordPress includes its own internal debug mode, which is built in. you can also use third-party software to help troubleshoot WordPress.
In this post we'll explore the WordPress built-in WordPress debug mode. It will show you how to activate it. In addition, we'll discuss some other ways you could troubleshoot the issues with your WordPress website.
It will cover everything:
- An introduction to WordPress debug mode as and the debug log
- How do I enable WordPress Debug Mode (three choices)
- Alternative methods for troubleshooting WordPress
What Can WP Debug do?
If you're experiencing issues with your site, WordPress debug mode can help you find out what's wrong, by displaying the entirety of PHP mistakes, notifications, and warnings.
If you select the debug option You'll see the following message whenever you encounter something wrong ( even if it's not creating immediate problems):
What's inside What's WordPress Debugging Log?
When you enable WordPress debug mode on the way that you prefer, you'll see the same messages as the example above in your blog at the moment - but those messages won't remain in any folder.
If this option is enabled, once you enable the WP_DEBUG_LOG constant to true, WordPress will write all issues to the following file:
wp-content/debug.log
But, you could also make a customized location save the log file to another place on the server.
If you would like to record the errors in your log however not reveal them publicly within the HTML of your site (like the screenshot example above) you can make use of the WP_DEBUG_DISPLAY constant that allows the debug mode to be activated but do not display any error messages on your site.
Most of the time, you'll need to combine WP_DEBUG_DISPLAY together with the WP_DEBUG_LOG.
How do I enable WordPress Debugg Mode?
In order to enable WordPress Debug Mode, there is a myriad of options. Three options will be described for enabling this mode:
How to Enable WordPress Debug Mode within My
It is useful in having the ability to swiftly turn on debug mode and display the messages on your website, however it isn't able to permit you to choose whether or not you want to show the contents of the WordPress debug log, or even if you want to display messages on live websites. If you want to use just the debug log it can be done to use the plugin within the next section.
To get started:
- Open your My dashboard.
- Choose the website on which you would like to enable debugging in the List of Websites List.
- Click on the Tools tab of the website's dashboard.
- Click to Allow to allow WordPress debugging.
Once you've completed your work with debug mode, you can turn off the mode by clicking the button to turn off the button that is located on the computer's dashboard:
How do I Use the WordPress Debug plugin?
If you're hosting in another location, you could as well find no-cost WordPress plugins for debugging that permit you to easily enable the debug mode. There are several options at WordPress.org however we suggest the WP Debugging plugin for free by Andy Questions..
Once you've been able to install and activate the plug-in, it will begin immediately. It will default the following parameters true(that means it is activates the features listed below):
WP_DEBUG- enables debug mode.WP_DEBUG_LOGThe log file saves messages. the log files.SCRIPT_DEBUG- SAVEQUERIES
The final two constants appear a little further down on this blog.
To set up a few choices for your setup you can go to Tools WP Debugging

When you're done, make sure that you disable the plugin, so it's not in debug mode.
Do you want to learn more about the methods that we've increased our volume by more than 1000%?
Join the 20,000+ who are receiving our weekly newsletter which contains tips from the inside. WordPress tricks!
What are the steps to manually enable WordPress Debug Mode?
Finally, you can also activate WordPress debug mode on your own by by adding the variables to your wp-config.php file.
To activate the standard WordPress debug option You must add this code snippet beneath the line which says /* That's all you need to do is put off making any edits! Happy blogging. */:
// Enable WP_DEBUG as a mode. define( 'WP_DEBUG', true );
Additionally, you can utilize any of these options based on the way you prefer:
// Enable Debug logging to the /wp-content/debug.log file
define( 'WP_DEBUG_LOG', true );
• Disable any display warnings and errors.
define( 'WP_DEBUG_DISPLAY', false );
@ini_set( 'display_errors', 0 );
Once you've finished after you're done, you can change the constants to true or pull the code and turn off the debug mode.
Make Sure to Disable the Debug Mode in WordPress After you've finished
This was mentioned above, however this is merely the reminder to never turn off debug mode when you've succeeded in the task of resolving your issue.
Other Methods of Debugging WordPress
Apart from the debugging tool built into WordPress that we have mentioned earlier Additionally you can use other built-in and third-party tools to assist you in debugging your WordPress website.
Script Debug
This can be useful when trying to evaluate changes you've made in the .js and .css files.
To enable SCRIPT_DEBUG, you can either:
- Use the WP Debugging plugin from above. It is enabled automatically.
- Include the following constant in the wp-config.php file -
define( "SCRIPT_DEBUG" is true );
Database query Debugging
- Every query to the database.
- The method that connects the database to make the query.
- What time did the question take.
For enabling query logs, you have two options:
- Make use of the WP Debugging plugin , mentioned earlier, which allows it to be used to be automatically.
- Include the following constant in the wp-config.php file -
define( "SAVEQUERIES" real );
The Query Monitor Plugin
- Database queries.
- PHP errors.
- Enqueued scripts and stylesheets.
- The user's capabilities.
It's a great tool overall. It's among the best WordPress debug tools that you'll discover which is why the tool is rated at least 5 stars in over 350 reviews.
Once you install and activate the plugin, you'll get some new options on the WordPress toolbar, which display details of the debug. Clicking on these options will open a new "Query Monitor" box. It provides the following information.

New Relic
Server Logs
Furthermore, the logs of the server may serve as a tool for troubleshooting WordPress.
If you host your site at the server, you'll be able to see the entire server log through the logs section of a site's dashboard.
If you are hosting on a different server then you'll have to check your host's documentation to learn which locations can be seen in the logs for your server.
Summary
If you have to investigate WordPress using its integrated WordPress debug mode, it is an effective way of analyzing PHP warnings and errors.
If you host your site with us, you can activate it directly within your account. If not, enable the plugins, or add code snippets to your site's wp-config.php file.
If you need assistance, you can use additional built-in or third-party software such as New Relic (your own license is needed) and the cost-free Query Monitor plugin.
Have you got any more queries about the best way to troubleshoot WordPress? Leave a comment below and we'll be sure to respond to your inquiry!
Make it easier to save time, money, and increase site performance:
- Support and assistance 24/7 support 24/7 support WordPress experts in WordPress hosting 24/7 support from WordPress hosting specialists.
- Cloudflare Enterprise integration.
- Reaching a global audience with 29 data centers around the world.
- Optimization by using the built-in Application to track Performance.
This post was posted on here