How Enable/Disable Debug Mode In WordPress
If you work in WordPress and need a way to enable debug more on it with a certain page to can get information about something wrong easily, all you need to add a PHP constant to the wp-config.php file.
WP_DEBUG is a PHP constant add to WordPress since Version 2.3.1 and has the boolean value true or false.
This code snippet will let you enable or disable debug mode with simple steps
Steps to enable/disable:
- Open your host root public_html folder
- Open the wp-config.php file with an integrated editor, if you work localhost opens the same file using any code editor IDE.
- Search about WP_DEBUG constant.
- Simply add the following code
- Save the changes and check your pages as the custom text will show in the single product page or archive pages.
- once do this step, open any page and get parameter to the URL like https://www.zytheme.com/?debug=debug
if ( isset($_GET['debug']) && $_GET['debug'] == 'debug') define('WP_DEBUG', true);
Get Parameter to URL like: