Simple WordPress Trick #1 – Switch Debug on/off

Sometimes you may need temporary switch debug on, to test something, then switch it off. You should go to ftp(or any other file manager) explore root folder, edit wp-config, save it, then test something and then edit again, save again. And plus in this case stranger visitors will also be able to open your website in debug mode. So simple trick is needed to do all these easily and safely.
Here is the simple trick to do it.
Go to wp-config.php, open it in editor, and replace
define(‘WP_DEBUG’, false); with

if (!empty($_GET["some_secret_parameter"])) define('WP_DEBUG', true);
else define('WP_DEBUG', false);

Type your own secret parameter instead of “some_secret_parameter”.
Then your website will work in debug=false mode. But you will always be able to open your website in debug=true mode with opening your website with such url:
This way is better right? 🙂 And safe, as nobody knows this secret_parameter but you.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.