↑ ↓ select, Enter open, Esc close

Enable the WordPress debug log without displaying errors

Caution: This command changes the system. Understand what it does before you run it.

Adjust the values, the command updates live
user@server
wp config set WP_DEBUG true --raw --path=/var/www/vhosts/example.com/httpdocs && wp config set WP_DEBUG_LOG true --raw --path=/var/www/vhosts/example.com/httpdocs && wp config set WP_DEBUG_DISPLAY false --raw --path=/var/www/vhosts/example.com/httpdocs

Sets three constants in wp-config.php: debug mode on, logging to wp-content/debug.log, no display in the browser. This captures PHP errors and warnings on live sites without exposing paths or messages to visitors. --raw makes sure true and false are written without quotes.

Note: By default, debug.log is publicly accessible and grows quickly. After troubleshooting, set WP_DEBUG back to false and delete the file.

Also searched as

  • find wordpress errors
  • enable wp_debug
  • turn on debug.log wordpress
  • find cause of white screen

Related one-liners

All in WP-CLI

Read first, then run.

The commands on myline.de act directly on servers, files and databases. A wrong path or placeholder can delete data irreversibly or make a server unreachable.

  • All commands are provided without warranty and are not tested on every system.
  • Understand what a command does before running it, and check every placeholder.
  • Make a backup first and, if possible, try it on a test system.
  • You run commands at your own risk. Liability for damages is excluded to the extent permitted by law.