No results found. Try again with different words?

Search must be at least 3 characters.

How to Enable Debugging in WordPress (Debug Mode)

Sidebar Image

Did not find a solution? We are here to help you succeed.

When working with your website, different themes, and plugins, youโ€™ll inevitably encounter some problems. This is where debugging can help.

Debug mode helps find and fix problems on your website by showing detailed error messages.

Common Conflicts and Their Solutions

Installing a new plugin or theme, updating, or adding a custom code can cause conflicts. Some issues will show immediately and can even make your website temporarily unusable (e.g., theย White Screen of Death).

Others will show only in certain situations and create issues with some functionality or plugin. These issues can often be solved by manually deactivating all of your plugins and re-activating them individually. This way you can find which plugin is creating the issue.

Further, you can switch to another theme to check if the issue is coming from that side. All of this takes a lot of time.

How Debug Mode Simplifies Troubleshooting

If you enable the debug mode, it will display a log of PHP errors and warnings. This can help you quickly find the source of the issue.

You could even use this to prevent some issues. Some errors, if they exist, will only be visible in the debug log even though everything seems fine on your website.

You can enable debug mode manually or using a plugin. We will show you how to do it using both methods.

Note: No matter which method you choose, Itโ€™s advisable to do this in your staging environment (same as your new installations, updates, etc.) as errors will become visible on both your front end and dashboard.

Method 1: Enable the Debug Mode Using a Plugin

If youโ€™re unsure about working with your website files or find Method 2 too complicated, the WP Debugging plugin is the right solution for you.

You can enable debugging using the plugin by following these steps:

Step 1: Navigate to Plugins > Add New from your WordPress dashboard.

Step 2: Type “wp debugging” in the search bar.

Step 3: Click the โ€œInstallโ€ button on the WP Debugging. Once the plugin is installed, click on the โ€œActivateโ€ button.

Step 4: Navigate to the Dashboard > Tools > WP Debugging;

Step 5: Click on the check box next to the โ€œSet WP_DEBUG to trueโ€ option and click on the โ€œSave Changesโ€ button.

Donโ€™t forget to disable the debug mode after youโ€™re done.

Method 2: Enable the Debug Mode Manually

Alternatively, if you prefer to do this manually and have no problem with editing your website files, or youโ€™re locked out of your website (e.g., White Screen of Death) and donโ€™t have another option, we will show you how this could be done by editing your wp-config.php file.

How to Access the “wp-config.php” File?

Before making any changes to any of your files, please create a complete backup of your website. Also, it is advisable to make a copy of the original file before editing it โ€“ in case something goes wrong, you can always use this original file to start over.

For this article, weโ€™ll use the FileZilla FTP client, so please install it on your computer (unless you are familiar with another FTP client you would prefer to use). Letโ€™s start:

Step 1: Add your FTP access data to FileZillasโ€™ Site Manager

Step 2: Connect to your server

Step 3: Navigate to your websiteโ€™s public_html (root) folder. Here you should find the found your wp-config.php file.

Step 4: Right-click on the file and select โ€œDownloadโ€™ to copy the file to your computer.

Step 5: Open the file using the code editor to edit it. You can edit the file using code editors like Sublime Text or Notepad++.

Step 6: Scroll down to the โ€œThatโ€™s all, stop editing! Happy publishingโ€ line

Step 7: Add the following value before that line and save changes:

define( 'WP_DEBUG', true);
define( 'WP_DEBUG_LOG', true); 

Step 8: Once you modified your file, just upload the file back to your server (using the FTP client), replacing the original file with this modified one.

By following these steps, you will enable your debug mode and create a debug.log file where your errors will be saved.

To disable the debug mode once youโ€™re done, repeat the steps for enabling, just this time, either completely remove the previously added code or modify it as follows:

define( 'WP_DEBUG', false);

How to Use the Debug Mode?

If youโ€™re trying to debug some issue youโ€™re currently experiencing, youโ€™ll need to repeat the steps that led to this issue once your debug mode is enabled.

This will make a new error log, and youโ€™ll be able to check it out.

Viewing the Debug Log

If you are using Method 1:

Click on the โ€œDebug Quick Lookโ€ menu in your admin bar on the top of your Dashboard screen. In the dropdown menu, click the โ€œView Fileโ€ option. This will open a new tab showing the errors in the debug log.

For Method 2:

To manually access your site files, navigate to the following path: “public_html/wp-content/debug.log” and open the file to view the errors in the debug log.

That’s it! We hope this article helps you. If you face any issues while debugging, feel free to reach out to us!

Was this article helpful?
Sidebar Image

Did not find a solution? We are here to help you succeed.

Related Docs

Join 1,653,898+ Happy Site Owners Using Astra

Whether you are a beginner, small business owner, or professional web developer, Astra provides all the tools you need to easily build your beautiful WordPress website.

Scroll to Top
Now choose your preferred
page builder addon
Choose your preferred page builder addon

Download is Just A Click Away!

Enter your email address and be the first to learn about updates and new features.

Download Free Astra Theme - Modal Popup Form