admin管理员组

文章数量:1122797

How can I remove any error notification on my live page. I want them on the back end only. This is what I see on my main page and I want it hidden.

Deprecated: Hook site-logo is deprecated since version 13.4! Use custom-logo instead. Jetpack no longer supports site-logo feature. Add custom-logo support to your theme instead: / in /var/www/wp-includes/functions.php on line 6078

How can I remove any error notification on my live page. I want them on the back end only. This is what I see on my main page and I want it hidden.

Deprecated: Hook site-logo is deprecated since version 13.4! Use custom-logo instead. Jetpack no longer supports site-logo feature. Add custom-logo support to your theme instead: https://developer.wordpress.org/themes/functionality/custom-logo/ in /var/www/wp-includes/functions.php on line 6078

Share Improve this question asked May 17, 2024 at 9:10 addyj76ersaddyj76ers 11 bronze badge 1
  • changing that isn't a WordPress setting, it's a PHP setting in php.ini, though you shouldn't be routing them to the frontend at all, errors should be sent to an error log file instead ( and ideally fixed, even deprecations/warnings are clues to bugs you might not be aware of that can have catastrophic consequences ) – Tom J Nowell Commented May 17, 2024 at 9:25
Add a comment  | 

1 Answer 1

Reset to default 1

In your wp-config.php look for the line reading:

define( 'WP_DEBUG', false );

(This is set to false by default, if you're troubleshooting it may be set to true on your install)

After it, add:

if( WP_DEBUG == true ) {

    /** Don't display WP errors */
    define( 'WP_DEBUG_DISPLAY', false );

    /** Log errors to debug.log in /wp-content instead */
    define( 'WP_DEBUG_LOG', true );

    /** Suppress PHP errors, which are normally turned on by WP_DEBUG */
    @ini_set( 'display_errors',0 );         
}

You should ideally be troubleshooting these errors on a local/dev copy of your site with an environment as close to the live site as possible.

本文标签: Live page errors should be hidden