Enabling WordPress Debug Log Mode

WP debug log

WordPress debugging helps us identify issues with our website. We can enable this feature using multiple methods, such as a plugin or cPanel. Enabling debug mode allows WordPress to show error messages, which can help us in diagnosing and fixing issues. When our website is live, we do not want visitors to see any WordPress error messages. These messages might expose sensitive details and create security risks or problems for our users.

However, sometimes enabling WordPress debugging becomes necessary to find and fix specific problems on our site. So, in this article, we will demonstrate multiple methods to enable WordPress debug log mode. 

What is the WordPress Debug Mode

In WordPress, debug mode is an in-built feature that shows you what’s going wrong when your website is not working properly. Normally, WordPress hides error messages so visitors (and sometimes even you) don’t see these messages. When you turn on debug mode, these hidden messages appear, which help you find the problem.

The error can be caused by a plugin conflict, a small coding mistake, or a theme problem. Enabling the debug mode gives you the information you need to fix it, either by yourself or with the help of a developer.

Enable WordPress Debug Mode (Fix “WordPress Debug Log Not Working” Issue)

You can enable WordPress debug mode to identify errors and warnings in our code. We can do this using different methods, like a WordPress plugin or cPanel. 

Method 1: Enable Debug Mode Using a WordPress Plugin

If WordPress debug mode is not working, using a plugin can simplify the process and reduce errors. It is an easy method for beginners or anyone who is not familiar with editing website files. In WordPress, WP Debugging is a free troubleshooting plugin that works immediately after installation. WP Debugging eliminates the need to manually edit any files on your website.

Install and Activate WP Debugging

First, we need to install and activate the WP Debugging plugin. To do this, navigate to your WordPress dashboard and install the WP Debugging plugin:

install wp debugging

After installing WP Debugging, activate it by clicking the highlighted button:

activate wp debugging

Set WP_DEBUG to True

Once activated, go to Tools and then WP Debugging in your WordPress dashboard. Then, make sure the ‘Set WP_DEBUG to true’ option is turned on:

enable debug mode wordpress

Check Errors and Fix Them 

After enabling the “Set WP_DEBUG to true”, hover over “Debug Quick Look” and click on the “View File” option:

check and fix errors

Clicking on the View File option will open the log file that contains all the error messages from your website. You can review these details to troubleshoot the actual problem. It tells you whether it’s a theme issue, plugin conflict, or something else. Once the problem is correctly identified, you can quickly fix it.

After checking and fixing the WordPress errors, make sure to turn off the debugging plugin to keep your site running smoothly and securely.

Method 2: Enable WordPress Debug Mode Using cPanel

If you want to enable debug mode manually or the plugin does not fix the problem, you can use the cPanel. cPanel provides direct access to your website’s files, which allows you to make necessary changes and troubleshoot effectively. 

Access File Manager

Log in to your cPanel account, go to the Files section, and open File Manager:

access file manager cpanel

Edit wp-config.php File

Navigate to the public_html folder where your WordPress files are stored, locate the wp-config.php file, right-click on it, and choose Edit:

edit wp-config fie

Enable WordPress Debug Mode

To turn on the basic WordPress debug mode, insert the code below just before the line that says:

define( 'WP_DEBUG', true );
enable debug mode

You can also use these optional settings as per your needs. These settings ensure that the errors are silently logged to the file and they do not appear on the live website:

define( 'WP_DEBUG_LOG', true );
define( 'WP_DEBUG_DISPLAY', false );

Paste the copied code right before the line that says: /* That’s all, stop editing! Happy publishing. */

When you’re done debugging, you can turn it off by either changing the values to false or deleting the code you added.

This setup ensures that all errors are saved in the wp-content/debug.log file. If your WP debug log is not working, make sure that: 

  • The wp-content folder has proper write permissions.
  • There is no typo in the define statements.
  • Your hosting environment supports file writing.

How to Fix WordPress Debug Mode Not Working

If you’ve set up everything appropriately but the WordPress debug log is still not working, try these steps:

  • Check if the “debug.log” file is in the “wp-content” folder. If it is missing, create it yourself and make sure it has write permissions.
  • Make sure no plugin or server setting is blocking PHP errors.
  • If the debug log is still empty, look at your server’s error log for more information.

How to Disable WordPress Debug Mode

We can disable WordPress debug mode by deactivating a WP Debugging plugin or by manually editing the wp-config.php file.

Method 1: Disabling WP Debugging Plugin

Log in to your WordPress dashboard, hover over Tools in the left menu, and click on WB Debugging. Now uncheck the “Set WP_DEBUG to true” option, and save changes to disable the WP debug log mode:

disable wp debugging plugin

Method 2: Editing the wp-config.php File in cPanel

If you prefer to disable debug mode manually, you can do this through cPanel. To do this, first, log in to your cPanel account, scroll down to the Files section, and open File Manager:

access file manager

In File Manager, navigate to public_html, and locate the wp-config.php file. Now, right-click on the wp-config.php file and select Edit. In this file, scroll down to find this line: “define( ‘WP_DEBUG’, true );”. Once found, change true to false, like this:

define( 'WP_DEBUG', false );
disable wp debug log mode

Finally, click Save Changes at the top of the page to disable the WordPress Debug log mode.

Final Thoughts 

You can enable WordPress debug mode to identify and fix errors on your website. It enables us to find errors that may not be evident, such as plugin conflicts, coding errors, or theme-related issues. Debug mode is great for finding and fixing errors, but don’t forget to turn it off afterward. Leaving it on while your site is live could reveal sensitive info and open up security risks.

In this write-up, we covered various methods to enable WordPress debug mode, including using a plugin and cPanel. We also provided tips for troubleshooting when the debug log is not working, as well as steps for disabling the debug mode once the issue is resolved.

We hope this article has helped you enable the WordPress debug log mode. Consider Ultahost’s fast, user-friendly, and secure WordPress hosting to improve the security of your website. Ultahost provides features like enhanced protection against unauthorized access and unlimited bandwidth. All these features are optimized for superior website performance.

FAQ

What is WordPress debug mode?
Is it safe to enable debug mode on a live site?
How can I enable debug mode without editing any files?
What should I do if the debug log file is not showing up?
How do I turn off WordPress debug mode?
Can I hide error messages from visitors but still log them?
Will enabling debug mode affect my site’s performance?

Related Post

How To Fix Sidebar Below Content Error In Wor

A well-structured WordPress website relies on a clear l...

How To Change Your WordPress Username?

WordPress is one of the most popular content management...

How to Change Font in WordPress

Typography plays an important role in the visual appeal...

wordpress amazon s3

Integration Guide for WordPress Amazon S3 and

Large files on your website negatively impact loading t...

How to change WordPress theme from Database u

Changing WordPress themes can be a powerful way to refr...

How to Fix “Background Request Blocked&

A common issue seen in WordPress often shows the error,...

Leave a Comment