Home » How to Enable Debug Mode in WordPress

How to Enable Debug Mode in WordPress

  • by
how to enable debug mode in wordpress

how to enable debug mode in wordpress

Do you know how to enable debug mode in WordPress? Although many people choose the WordPress platform, WordPress users still find problems with their website.

 

If your WordPress website has an error, you can activate the debug mode in WordPress and the error will be recorded in the debug log. You will be able to edit wp-config.php and also view WordPress Error Logs.

 

What is WordPress Debug Mode?

Before you learn how to enable WordPress debug mode, it’s a good idea for you to know what debug mode is.

Debug mode in WordPress will be very useful in solving problems on WordPress websites and will be recorded as an error.log file. That way you can find out the cause of the problem on your WordPress website.

 

WordPress gives users the freedom to add plugins or change WordPress themes. But often when you add a theme, WordPress gets an error and can’t be accessed. This is certainly very disturbing, right?

Basic Managed WordPress Websites GoDaddy

Basic Managed WordPress Websites GoDaddy

The main reason to enable WordPress debug mode is to fix errors that occur in PHP. As already explained, using WordPress will make it very easy for users to do what they want to change in these settings, for example adding plugins or changing themes.

In order to avoid errors that will disrupt the site, a debug mode is needed.

 

In general, debug mode is intended for use by developers and should not be used on their live sites. However, in this case you can also use it in certain scenarios to help troubleshoot any problems you may be experiencing.

 

One way is to use a plugin or theme. In this case WordPress uses a special debugging system, to simplify and standardize the WordPress debugging process, code in plugins, addons, and WordPress core.

 

How to Enable WordPress Debug Mode in WordPress

Once you know what debug mode is and how it works, now you can choose the most suitable way to enable it in WordPress. You can use a WordPress plugin or the manual method, but don’t forget to disable the feature again after you’re done troubleshooting.

 

This is because the WordPress debug mode will display your website’s PHP error code so that it is visible to visitors. It is very risky for this information to be used by malicious hackers to their advantage. Here’s how to get started:

  1. Enable WordPress Debug Mode With Plugin

If you are a WordPress user who is just learning you should use this method. You just need to install the WP Debugging plugin so you don’t need PHP code and avoid the possibility of further errors occurring.

First, install WP Debugging and activate the plugin. The WP Debugging plugin will set the following value to “true” in the wp-config.php file automatically:

define( ‘WP_DEBUG’, true );

define( ‘WP_DEBUG_LOG’, true );

define( ‘SCRIPT_DEBUG’, true );

define( ‘SAVEQUERIES’, true );

 

You can access via Debug Quick Look all website errors, notifications, and warnings.

Click Tools – WP Debugging – Debugging Constants to apply additional setting “WP_DISABLE_FATAL_ERROR_HANDLER” or disable “WP_DEBUG” and “WP_DEBUG_DISPLAY“.

Don’t forget to deactivate the plugin when you’re done to restore the pre-existing constants.

 

  1. Enable WordPress Debug Mode Manually

You can enable WordPress debug mode by using WP-Config and activate it is as follows:

  • Go to File Manager. Then find the directory where WordPress is installed.
  • Locate the wp-config.php file. Press right click, then select edit. In making this edit, you should use notepad++ to edit it. This is of course to make it easier to make edits.
  • Then look for posts like the following:

define( ‘WP_DEBUG’, false );

 

  • If you have found, then delete and replace as below;

define(‘WP_DEBUG’, true);

define( ‘WP_DEBUG_LOG’, true );

 

  • If you don’t find any posts, define(‘WP_DEBUG’, false); (as in the third point), then you must add the following text:

define(‘WP_DEBUG’, true);

define( ‘WP_DEBUG_LOG’, true );

Just before writing:

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

 

However, you can skip this fourth step if you have added it in the third step. Save the file, then re-upload with hosting. At this point you have successfully enabled debug mode on your WordPress website.

 

Conclusion

Learning how to enable debug mode in WordPress is an important skill. It can help you troubleshoot common WordPress errors and quickly identify the cause of the problem. Fortunately, this process doesn’t have to be difficult, and you don’t have to fiddle with the website’s code if you’re not sure about it.

In this article, you’ve learned two ways to enable WordPress debug mode:

  • Use a plugin like WP debugging.
  • Edit your wp-config.php file.

 

Hopefully it can be useful for you.

Leave a Reply

Your email address will not be published.