Browsing Tag

debug mode

WordPress Tips

Turn on off WP DEBUG mode in WordPress

September 15, 2017

WordPress has a feature to DEBUG code (finding bugs) in developing environment. When this option is turned on, developers will see all notices and errors that come from the code. That’s great for deveoping themes and plugins.

However, when come to production environment, that option should be turned on. It’s because sometimes the notices or warnings are harmless to your site. You may install many plugins and many of theme do not care about notices or warnings. If the messages (of those notices and warnings) appear on the screen, users will feel uncomfortable. In some cases, those messages can break the site layout.

Thus, it is recommended to turn of DEBUG mode in live site. To do that, open /wp-config.php file (at the root folder of your site). You will see this line of code

define(‘WP_DEBUG’, false);

Change the value from true to false (and vice versa) to turn it off/on

define(‘WP_DEBUG’, true);

Remember to save the file. You can do this by using a file manager tool (often provided by your hosting) or a FTP app. The DEBUG mode will be handy if you see your site breaks in the middle of rendering the layout or you see a white/blank page. Turn it on, copy the message (of fatal errors) and send it to your technical supporters.