• On wp-config.php, there is e.g. WP_DEBUG=true. All of the users are seeing errors and warnings when I am fixing something. I don’t want the users too see that. So this is an minor irritating for the potensial common users.

    I dont want to have WP_DEBUG_LOG=true either with text file. I want to see directly on errors and warnings. How can I have WP_DEBUG is true on logged in as admin, and WP_DEBUG is false on users?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Hi

    Not sure if there’s a away to do it exactly like the way you want.
    You can set define( 'WP_DEBUG_DISPLAY', false ) and this should turn error display off. But I assume this will also trigger them off for you.

    Then have define( 'WP_DEBUG_LOG', true ); and tail it using ssh as this:
    tail -f debug.log

    Hi @thedani

    Currently, enabling the debug will really show the debug error message for admin, non-admin, and even normal visitor.

    Your best option is really by using or enabling the debug log, then it will generate a file called debug.log in /wp-content

    Or use plugin like Debug Bar https://www.ads-software.com/plugins/debug-bar/ where you can see the debug message in the WP Dashboard.

    Thread Starter TheDani

    (@thedani)

    define( ‘WP_DEBUG_LOG’, true ) is a detour/a bit long way to see the it (cd folder on errors, choose between “Reopen local file” or “Discard local file…”, read the log, fix it, cd folder again on normal folder, some minutes later I have to cd folder on errors again, choose between “Reopen local file” or “Discard local file…”, read the log again, fix it, cd folder again on normal folder again, and so on on filezilla), but thank you for Debug Bar.

    • This reply was modified 2 years, 6 months ago by TheDani.
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘WP_DEBUG=true is only on admin’ is closed to new replies.