Life Time Extra Credits Offer Extended

Validity: Dec 05 - Dec 12, 2025

How To Enable WP_DEBUG Mode In WordPress

|
Background Gradient

Troubleshooting errors is simpler when you have a method to detect these problems early. Wondering how to detect issues in your WordPress configuration quickly? Well, WP_DEBUG mode can help.

In this tutorial we are going to show you how to locate the WP_DEBUG in your WordPress site installation, how to edit and enable it with the local file editor and InstaWP.

Follow along as we guide you on how to enable it.

What is WP_DEBUG?

WP_Debug is a WordPress PHP constant that when enabled or set to true activates debugging and error reporting. The WP Debug code can be found in the wp-config.php file of your WordPress installation.

Must Read: wp_debug and How to Work with It Like a WordPress Troubleshooting Pro?

How WP_DEBUG Works

Errors and warnings in WordPress websites are common when you pick behind the scenes when developing or troubleshooting. Often, you would want to know why such errors and warnings occurred.  

The WP_Debug provides ways for you to see these errors and warnings that might be hiding in the shadows of your website’s code. It’s a valuable tool that assists in troubleshooting and fixing issues.

Let’s consider a scenario for testing purposes and see how the WP_DEBUG helps you see issues and fix them.

We’ll use a plugin that is known to be buggy to demonstrate. There are a number of them, but we’ll experiment with Health Check & Troubleshooting.

Must Read: How to Get Over WordPress Troubleshooting Woes →

Let’s create a page or post that has a broken link. 

  1. Navigate to the “Posts” or “Pages” section, depending on where you want to create the broken link.
  1. Click on “Add New” to create a new post or page.
  1. Give your post or page a title, such as “Broken Link ” your choice. 
Enable WP_DEBUG Mode In WordPress,WP_DEBUG Mode In WordPress,How To Enable WP_DEBUG Mode,WordPress configuration,WP DEBUG Mode
  1. Let’s go and create the broken link. Select a word or phrase in your content that you want to turn into a broken link. When you select the words or phrase, a toolbar box will pop up. Click on the chain-like icon in the toolbar.
  1. In the link dialog box that appears, enter a URL that does not exist or a non-existent page on your own website.
Enable WP_DEBUG Mode In WordPress,WP_DEBUG Mode In WordPress,How To Enable WP_DEBUG Mode,WordPress configuration,WP DEBUG Mode
  1. Publish your post or page.

When you click on the link in the published page, you’ll most likely get a “404 Page Not Found.”

Enable WP_DEBUG Mode In WordPress,WP_DEBUG Mode In WordPress,How To Enable WP_DEBUG Mode,WordPress configuration,WP DEBUG Mode

How To Enable The WP_Debug in WordPress?

Enabling the WP_Debug mode in WordPress means you know where to find this PHP constant. 

Locate The WP_Debug In WordPress

If you don’t know where or how to find the WP_DEBUG in WordPress, follow these steps. 

  1. In the WordPress installation file, navigate to your installation folder. You can get to your installation folder via FTP client, Cpanel, or your local machine if you are running WordPress through the local machine. 
  1. Typically you will find 3 main folders and some other files. But let’s focus on the folder where you will find the file containing the WP_Debug PHP constant.
  1. Open the App folder, you will see only one folder named Public. Again open the folder called Public. 
Enable WP_DEBUG Mode In WordPress,WP_DEBUG Mode In WordPress,How To Enable WP_DEBUG Mode,WordPress configuration,WP DEBUG Mode
  1. In the Public folder, you will see a bunch of files and folders. In this tutorial, we are only concerned with one of those files. Look for the wp-config.php file. See this screenshot from a local file.
Enable WP_DEBUG Mode In WordPress,WP_DEBUG Mode In WordPress,How To Enable WP_DEBUG Mode,WordPress configuration,WP DEBUG Mode
  1. In the wp-config.php file, you will see PHP constants for different functions. At the nearest end, you will find the PHP code that we want to change its constant.

Method 1: Enable WP_DEBUG Mode Using a Local File Editor

Note: This method is tricky, long, and suitable for those who understand WordPress well. Method 2 (check next section) is comparatively much easier to follow. ?

There is a wide range of local file editors at your disposal for writing and editing code, each with its own unique features and capabilities. You have the opportunity to explore these local file editors extensively, allowing you to determine which one is most suitable for your specific use case.

Enabling the WP-DEBUG mode using a local file editor is a straightforward process but first, you need to be able to access WordPress installation from your computer. Below are simple steps on how to do that:

  1. Download your WP Installation file from your InstaWP dashboard. In the dashboard, select the 3 dots dropdown menu and you will see Export As > LocalWP. Click on LocalWP and your WordPress installation file will be downloaded to your computer. Open the file with any local file editor and start editing your WordPress site.
  1. The backup and Migration plugin can also give you the option to download your WordPress installation, which you can access locally. In the process of backing up your WordPress, there are plugins that offer you the option to download your backup file to your computer. Some popular backup plugins include UpdraftPlus, BackupBuddy, and Duplicator. Check the documentation or settings of your chosen plugin to learn how to create a backup and download it to your local computer.
  1. Set up a local development environment: Start by setting up a local web server on your computer. You can use software like XAMPP (for Windows, macOS, and Linux), MAMP (for macOS), or WAMP (for Windows). These tools provide a web server (Apache), a database server (MySQL), and PHP, which are required for running WordPress.
  1. Some web hosting control panels, such as cPanel, provide functionality for creating backups of your website. You can access the control panel provided by your hosting provider and look for backup options. From there, you can generate a backup of your WordPress site and download it to your local computer.

Now that you are sure you have access to your WordPress installation, follow these steps to enable WP_DEBUG mode:

  1. Go to the directory/folder where your WordPress installation resides. Open the installation file with your preferred local file editor.
  1. Locate wp.config.php file (in the root folder). This file holds important configuration settings for your WordPress site.
  1. Now look for the line that says define(‘WP_DEBUG’, false);. By default, WP_DEBUG is set to “false” to disable debug mode.
  1. To enable WP-DEBUG mode, change false to true. The line should now read: define(‘WP_DEBUG’, true);.
  1. Finally, Save the changes to the wp-config.php file.

Method 2: How To Enable WP_DEBUG With The InstaWP File Editor?

To enable WP_DEBUG mode with the InstaWP file editor, you need to have an InstaWP account. To create an account, go to https://app.instawp.io/onboard

Let’s find the site where we want to enable WP_DEBUG mode in the dashboard. 

  1. On the far right of that site, click on the 3 dots icon in the toolbox. This will open a dropdown of additional tools for that site.
  1. Now, find the feature that says “Tools”. Navigate to the tool option that says “Code Editor”.
  1. Click on “Code Editor,” and the InstaWP custom file editor will open in a new tab. 
  1. Find the “wp-config.php file.
Enable WP_DEBUG Mode In WordPress,WP_DEBUG Mode In WordPress,How To Enable WP_DEBUG Mode,WordPress configuration,WP DEBUG Mode
  1. Open the file, scroll down a little and you will see the PHP constant that we want to edit.
Enable WP_DEBUG Mode In WordPress,WP_DEBUG Mode In WordPress,How To Enable WP_DEBUG Mode,WordPress configuration,WP DEBUG Mode
  1. Change the false to true and save. Exit the file editor and you have successfully enabled WP_DEBUG mode with InstaWP file editor.

In addition, InstaWP provides a tool for you to view the error logs of your site. 

To view the error log of your site, go to “Tools”, then click on “View Logs”. This pop image will show.

Enable WP_DEBUG Mode In WordPress,WP_DEBUG Mode In WordPress,How To Enable WP_DEBUG Mode,WordPress configuration,WP DEBUG Mode

You will see the option to view 4 different logs which will enable you to troubleshoot and fix the errors.

How To Enable WP_DEBUG mode Using Configurations For New Sites?

By default, WP_DEBUG mode in the new WordPress installation is set to false. With InstaWP, you can enable WP_DEBUG mode for a completely new site with configuration. Let’s see what it looks like.

Enable WP_DEBUG Mode In WordPress,WP_DEBUG Mode In WordPress,How To Enable WP_DEBUG Mode,WordPress configuration,WP DEBUG Mode

Open “Configuration” and you will see where to configure your new WordPress site.

Select “WordPress”  and set default configuration for your site’s “wp-congig.php” file. Select the WP_DEBUG box.

Enable WP_DEBUG Mode In WordPress,WP_DEBUG Mode In WordPress,How To Enable WP_DEBUG Mode,WordPress configuration,WP DEBUG Mode

Save your settings. 

With this configuration, your site will have WP_DEBUG mode enabled from the start.

Conclusion

Navigating the world of WordPress can be an adventurous journey filled with opportunities and challenges. Whether it’s activating WP_Debug mode to uncover hidden errors and warnings or intentionally creating a broken link post or page, there are tools and techniques available to troubleshoot and enhance the WordPress experience. Among these tools, InstaWP stands tall and encompassing, a holistic companion for WordPress development.

FAQs on WP Debug Mode in WordPress

What is WP debug?

WP debug is a built-in feature in WordPress that helps developers identify issues by displaying PHP errors and warnings on the site. It can be enabled by setting the WP_DEBUG constant to true in the wp-config.php file, allowing you to troubleshoot problems effectively.

How do I enable WordPress debug mode?

To enable WordPress debug mode, add the following line to your wp-config.php file: define(‘WP_DEBUG’, true);. This will display errors, warnings, and notices on your site. You can also enable additional logging features for more detailed error reporting.

Alternatively, you can use the InstaWP staging environment to go it faster (and without editing the code. Here’s how to do it.

What is the difference between WP_DEBUG and WP_DEBUG_LOG?

WP_DEBUG activates the debug mode, displaying errors and warnings on the site. In contrast, WP_DEBUG_LOG saves these errors to a debug.log file in the wp-content directory, allowing developers to review errors without displaying them to site visitors.

What happens when I set WP_DEBUG to true?

When you set WP_DEBUG to true in your wp-config.php file, WordPress will display all PHP errors, notices, and warnings on the front end. This is useful for debugging but should be disabled on live sites to prevent sensitive information from being exposed.

How can I enable WP debug in my WordPress installation?

To enable WP debug, edit your wp-config.php file and add or modify the line: define(‘WP_DEBUG’, true);. You can also add define(‘WP_DEBUG_LOG’, true); to log errors to a file, and define(‘WP_DEBUG_DISPLAY’, false); to hide errors from visitors.

What should I do if WordPress debug mode is not working?

If WordPress debug mode is not working, ensure that you’ve added the correct code to your wp-config.php file. Check for syntax errors, and make sure other settings like WP_DEBUG_DISPLAY are properly configured. Additionally, ensure your server’s error reporting settings allow for debug output.

How do I enable debugging in WordPress?

To enable debugging in WordPress, open your wp-config.php file and set define(‘WP_DEBUG’, true);. Optionally, include define(‘WP_DEBUG_LOG’, true); to save errors to a log file. Always remember to disable debugging on production sites for security reasons.

What does WP debug mode do?

WP debug mode displays errors, notices, and warnings directly on your WordPress site. It helps developers identify issues with plugins, themes, and custom code. This feature is crucial for troubleshooting but should be disabled on live sites to protect sensitive information.

How do I configure debugging in wp-config.php?

To configure debugging in wp-config.php, add the line define(‘WP_DEBUG’, true);. For more detailed logging, you can add define(‘WP_DEBUG_LOG’, true); to log errors to a file, and define(‘WP_DEBUG_DISPLAY’, false); to prevent errors from displaying on the site.

How can I enable debug mode in WordPress?

Enable debug mode in WordPress by adding define(‘WP_DEBUG’, true); to your wp-config.php file. You can further enhance debugging with define(‘WP_DEBUG_LOG’, true); to log errors to a file, ensuring easier tracking and management of issues during development.

Vikas Singhal

Founder, InstaWP

Vikas is an Engineer turned entrepreneur. He loves the WordPress ecosystem and wants to help WP developers work faster by improving their workflows. InstaWP, the WordPress developer’s all-in-one toolset, is his brainchild.
Like the read? Then spread it…
Facebook
Pinterest
LinkedIn
Twitter
You might also like

Get $25 in free credits — start building today.

Create your first site and unlock all premium features today.

Request demo

Wondering how to integrate InstaWP with your current workflow? Ask us for a demo.

Contact Sales

Reach out to us to explore how InstaWP can benefit your business.