There comes a time you may want to add a debug to the WordPress website to pinpoint any error that may occur as a result and address them.

To do that, log in to cPanel and access the File Manager in the main page’s Files section.

Select it and click Edit in the menu bar and the file will open in cPanel’s text editor.

Scroll down to the line that reads:

/* That's all, stop editing! Happy blogging. */

Add the following code above that line and then click Save :

define( 'WP_DEBUG', true );
    define( 'WP_DEBUG_LOG', true );
    define( 'WP_DEBUG_DISPLAY', false );
@ini_set( 'display_errors', 0 );

WordPress will now start writing error messages to a file called error.log in the wp-content directory.

To disable error logging in WordPress and prevent your users from seeing any errors on your WordPress sites, simply undo the previous steps.

Or add these lines to the site's wp-config.php file:

ini_set('display_errors', 'Off');
ini_set('error_reporting', E_ALL );
define('WP_DEBUG', false);
define('WP_DEBUG_DISPLAY', false);
Was this answer helpful? 0 Users Found This Useful (0 Votes)