WeWP
ComparePricingFeaturesContact UsLoginTry For Free
  • Knowledge Base
  • How to Fix "Not Secure" or "Not Private" Connection Errors
  • How to Add Cron Jobs
  • Connect to Your Server via SSH on Windows
  • Keeping Servers and Sites Secure
  • Troubleshooting Cloudflare Issues
  • Install WordPress Themes and Plugins with Composer
  • How To Fix Mixed Content Issue For WordPress
  • What Is a DDoS Attack and How to Prevent It?
  • How to Enable WordPress Debug Mode
  • How to Fix the “MySQL server has gone away” Error
  • How to Configure WP Mail SMTP Plugin to Send Emails
  • How To Fix the “HSTS Missing From HTTPS Server” Error
  • How to Check Your Domain's Expiration Date
  • How to Use and Serve WebP Images in WordPress
  • Email security best practices for using SPF, DKIM, and DMARC
  • What is a LEMP (Linux, Nginx, MySql, PHP) Stack?
  • Deploying Web Applications with NGINX HTTP Server
  • How to Configure WP Rocket Plugin for WordPress
  • How to Check SPF and DKIM Records with WeWP
  • Understanding FTP vs SFTP: Which Should You Use for Secure File Transfers?
  • What is a DMARC record and How to Set it Up?
  • How to Set Up Cloudflare’s Free CDN for WordPress
  • How to check your Ubuntu version (Using the command line and GUI)
  • How to Download Backups from WeWP panel
  • How to Change the PHP Version of Your Hosting Plan
  • Troubleshooting Cloudflare Universal SSL
  • How to Fix “Your Domain Is Not Pointing” Error
  • SSH vs SSL: What’s the Difference?
  • WordPress Search and Replace
  • How to Force HTTPS on WordPress Websites
  • How to Fix a Failed Lifetime SSL Installation
  • How to Redirect HTTP to HTTPS
  • How to Monitor System Processes Using htop Command
  • Varnish vs Nginx FastCGI Cache: Which is Best for WordPress?
  • What Is the Database information_schema on phpMyAdmin?
  • How to Disable WP-Cron for Faster Performance
  • How to fix the ERR_SSL_PROTOCOL_ERROR
  • How to fix the NET::ERR_CERT_AUTHORITY_INVALID error
  • How to Add Expires Headers in WordPress
  • How to fix the “There has been a critical error on your website” error
  • How to Fix ERR_QUIC_PROTOCOL_ERROR in Chrome Browser
  • What Is Localhost? And How Does It Apply to WordPress?
  • How to Fix a Mixed Content Warning on Your Website
  • How to Fix the "Connection Timed Out" Error in WordPress
Powered by GitBook
On this page
  • What is WordPress Debug Mode?
  • When Should You Enable WordPress Debug Mode?
  • How to Enable WordPress Debug Mode in native WordPress
  • How to Enable WordPress Debug Mode in Composer-based WordPress
  • If you are using WeWP hosting, here are the steps on how to enable WordPress debug mode.

Was this helpful?

How to Enable WordPress Debug Mode

Debugging in WordPress is essential for keeping your website running smoothly and free of errors. Whether you're an expert or a beginner, learning to use WordPress's built-in debug tools is key to better troubleshooting. If you use WeWP for hosting, using WordPress Debug Mode is easy and effective.

In this guide, we'll show you how to activate WordPress Debug Mode in a few simple steps. This will help you see detailed information about errors, warnings, and notices on your website. By learning efficient debugging techniques, you can improve your website's performance and provide a better user experience.

What is WordPress Debug Mode?

WordPress Debug Mode is a feature that helps you find and fix problems on your website. When you turn it on, it shows detailed error messages, warnings, and notices. This makes it easier to understand what's wrong and fix it, so your website runs smoothly. It's useful for developers and anyone who wants to keep their WordPress site in good shape.

When Should You Enable WordPress Debug Mode?

You should enable WordPress Debug Mode in the following situations:

  • During Development: When building or customizing your site, catch and fix errors early.

  • Troubleshooting Issues: When your site is experiencing problems, identify the source of errors, warnings, or notices.

  • Testing New Plugins or Themes: Before making them live, ensure compatibility and functionality without errors.

  • After Updates: Following updates to WordPress, themes, or plugins, to catch any new issues that may arise.

Remember to disable Debug Mode on a live site to prevent displaying sensitive information to visitors.

How to Enable WordPress Debug Mode in native WordPress

Before we get into how to enable WordPress Debug Mode, let's look at the different ways to activate it.

If you're comfortable with the code, you can manually edit the wp-config.php file using SSH or an SFTP client. Another easy method is to install a WordPress plugin called WP Debugging.

Here's a quick explanation of the PHP flags we'll use:

  • WP_DEBUG: Turns on debug mode.

  • WP_DEBUG_LOG: Saves error messages to a debug log file.

  • WP_DEBUG_DISPLAY: Controls whether error messages are shown on the website.

Now, let's move on to the step-by-step guide.

How to Enable WordPress Debug Mode in Composer-based WordPress

Before we get into how to enable WordPress Debug Mode, let's look at the different ways to activate it.

If you're comfortable with code, you can manually edit the .env file using SSH or an SFTP client. Another easy method is to install a WordPress plugin called WP Debugging.

Here's a quick explanation of the environment variable flags we'll use:

  • WP_ENV='production': Turns off debug mode

  • WP_ENV=’staging’: Turns off debug mode

  • WP_ENV=’development’: Turns on debug mode

Now, let's move on to the step-by-step guide.

Prerequisites

  • A basic understanding of SFTP (Secure File Transfer Protocol) and SSH (Secure Shell) is essential for accessing and editing files on Cloudways.

  • It is necessary if you understand the structure and content of the wp-config.php file, as it is where WordPress Debug Mode settings will be modified.

  • Please be aware of the risks associated with debugging, as enabling Debug Mode exposes detailed error information, including sensitive data.

Alternatively, you may also seek help from your web developer if you are uncomfortable handling this to ensure proper execution without compromising site security or functionality.

Important Note

If you are using WeWP hosting, here are the steps on how to enable WordPress debug mode.

First of all, please select your WordPress type:

  1. Native

  2. Composer based

Native WordPress

Step: #1 You need to connect the server through SSH/sFTP and then perform the below steps to enable debug mode.

Step: #2

  1. To locate the wp-config.php file, use the following command.

a. cd /sites/your_site_name/files

  1. Next, you can simply modify the file by executing the following command.

a. nano wp-config.php

Step: #3

  1. Find the line that says define('WP_DEBUG', false);.

  2. Replace false with true: define('WP_DEBUG', true);.

  3. Optionally, add the following lines to display all errors:

a. define('WP_DEBUG_DISPLAY', true);

b. define('WP_DEBUG_LOG', true);

  1. Save the changes (in nano, press Ctrl + O, then Enter, and Ctrl + X to exit).

  2. Debug mode is now active. To view errors, use a command like:

a. cat wp-content/debug.log.

  1. After completing the troubleshooting process, disable debug mode by setting WP_DEBUG to false and deleting the extra code snippet. Leaving debug mode enabled could pose security risks to your website.

Composer based WordPress

Step: #1 Need to take ssh access to your server.

Step: #2

  1. To locate the wp-config.php file, use the following command.

a. cd /sites/your_site_name/files

  1. Next, you can simply modify the file by executing the following command.

a. nano .env

Step: #3

  1. Find the line that says WP_ENV='production'

  2. Replace false with true: WP_ENV='development’

  3. Save the changes (in nano, press Ctrl + O, then Enter, and Ctrl + X to exit).

  4. Debug mode is now active. To view errors, use a command like: cat web/app/debug.log.

  5. After completing the troubleshooting process, disable debug mode by setting WP_DEBUG to false and deleting the extra code snippet. Leaving debug mode enabled could pose security risks to your website.

PreviousWhat Is a DDoS Attack and How to Prevent It?NextHow to Fix the “MySQL server has gone away” Error

Last updated 12 months ago

Was this helpful?

We recommend taking an before editing the wp-config.php file, which requires precision and care. Having a backup is a proactive measure to ensure your site's safety and integrity. You can also to a previous point if unforeseen issues arise.

application backup
restore your application