on maintenance WordPress When working on a website, whether it's installing a new plugin, switching themes or modifying code, you often run into a variety of unexpected problems. Debugging mode (
![图片[1]-WordPress 调试模式开启指南:快速排查插件与主题问题](https://www.361sale.com/wp-content/uploads/2025/04/20250415155457376-image.png)
This article will introduce the role of debug mode and provide two practical ways to turn it on for different usage scenarios.
The significance of turning on debug mode
The debug mode can record PHP Error reporting, warning and notification messages. Turning on debug mode often provides a useful clue when a site is
- White screen or abnormal functioning of the page after installing or updating the plugin/theme
- Certain functions are not working, but there is no visible error message.
- Everything is fine on the frontend of the site, but the backend crashes frequently
- Need to identify hidden errors in the code execution logic
Debug logs can be used not only to fix current problems, but also to prevent potential risks.
Method 1: Use WP Debugging plugin to enable debugging mode
If you are not familiar with the code or FTP operation, it is recommended to use the plugin to quickly complete the debug mode open.
The procedure is as follows:
- log in WordPress Backend, click Plugins > Install Plugins
- Type in the search field WP Debugging
- Click "
mounting ", followed by clicking on "start using"
![图片[2]-WordPress 调试模式开启指南:快速排查插件与主题问题](https://www.361sale.com/wp-content/uploads/2025/04/20250415154621431-image.png)
- go into Tools > WP Debugging
- Check the box "Set WP_DEBUG to
true " and save the settings
![图片[3]-WordPress 调试模式开启指南:快速排查插件与主题问题](https://www.361sale.com/wp-content/uploads/2025/04/20250415154628249-image.png)
At this point, debug mode is enabled. After completing the debugging task, please disable this feature so that the error message is not exposed to the foreground.
Method 2: Manual modification wp-config.php file
When the backend of the site is not accessible, or if you prefer to do it manually, you can modify the wp-config.php file to enable debug mode.
The steps are as follows:
- utilization FTP tool (such as FileZilla) to connect to the server
- Find the root directory of your website (usually
public_html) in thewp-config.phpfile - Download the file locally and open it with a text editor (e.g. Notepad++, Sublime Text)
- Find the following line of code:
/* That's all, stop editing! Happy publishing. */
- Add the following above the line:
define( 'WP_DEBUG', true );
define( 'WP_DEBUG_LOG', true ).
- Save changes and upload the file to overwrite the original
Upon completion.WordPress will be in wp-content folder automatically generates a debug.log Log file for all error messages.
Methods to turn off debug mode:
Repeat the above steps to change the code to:define( 'WP_DEBUG', false );
Or just delete the relevant code.
Methods for viewing debug logs
When debug mode is enabled, you can view the error log as follows:
- When using the plug-in: In the backend top menu click on "
Debug Quick Look ", and then select "View File", will display the debug log content in a new tab
![图片[4]-WordPress 调试模式开启指南:快速排查插件与主题问题](https://www.361sale.com/wp-content/uploads/2025/04/20250415154800422-image.png)
- In manual mode: Login FTPEnter
wp-contentfolder, find thedebug.logfile, open it with a text tool to view
Recommendations for use
- Turning on debug mode is recommended to operate in a test site or development environment
- Backup before modifying any file to avoid unrecoverable
- Debugging should be turned off in a timely manner after the problem has been troubleshooted
summarize
The debugging mode is WordPress An important diagnostic tool in the system. Whether you are a novice webmaster or a developer, you can use it to quickly locate the problem when you encounter plugin conflicts, code errors or page anomalies. Through the plug-in or manual two ways, you can choose flexibly according to their own needs.
Related articles
Link to this article:https://www.361sale.com/en/50245/The article is copyrighted and must be reproduced with attribution.


















![表情[wozuimei]-光子波动网 | WordPress教程、Elementor教程与故障修复](https://www.361sale.com/wp-content/themes/zibll/img/smilies/wozuimei.gif)
![表情[baoquan]-光子波动网 | WordPress教程、Elementor教程与故障修复](https://www.361sale.com/wp-content/themes/zibll/img/smilies/baoquan.gif)

No comments