GET /debug
Returns the current state of WordPress debug constants and error log metadata.Response
Current value of the
WP_DEBUG constant.Current value of the
WP_DEBUG_LOG constant.Current value of the
WP_DEBUG_DISPLAY constant.Current value of the
SAVEQUERIES constant.Current value of the
SCRIPT_DEBUG constant.Absolute path to the detected error log file.
Whether the error log file exists on disk.
Error log file size in bytes.
0 if the file does not exist.Whether
wp-config.php is writable, which is required for toggling constants.POST /debug/toggle
Writes updateddefine() statements for the specified debug constants into wp-config.php. If a constant is not yet present in wp-config.php, it is inserted before the /* That's all, stop editing! */ marker.
Parameters
Set
WP_DEBUG to true or false.Set
WP_DEBUG_LOG to true or false. When true, errors are written to wp-content/debug.log.Set
WP_DEBUG_DISPLAY to true or false. When false, errors are hidden from page output.Set
SAVEQUERIES to true or false. When true, database queries are saved for inspection.Set
SCRIPT_DEBUG to true or false. When true, WordPress uses unminified versions of core CSS and JavaScript files.Response
Always
true on success.Confirmation message.
New value of
WP_DEBUG.New value of
WP_DEBUG_LOG.New value of
WP_DEBUG_DISPLAY.New value of
SAVEQUERIES.New value of
SCRIPT_DEBUG.GET /debug/log
Reads the last N lines of the WordPress error log. Supports optional filtering by severity level.Parameters
Number of lines to return from the end of the log file. Defaults to
200.Filter log output by severity. Accepted values:
error, warning, notice, deprecated. When omitted, all lines are returned.Response
Whether the error log file was found on disk.
Log file content (last N lines, optionally filtered). Empty string if the file does not exist.
Total log file size in bytes.
Absolute path to the log file.
The requested number of lines.
The level filter that was applied, if any.
DELETE /debug/log/clear
Clears the error log by truncating the file to zero bytes. Returns a success response even if the file does not exist.Response
Always
true.Confirmation message, or a note that the log file did not exist.
