How to Hide Deprecated Notices in WordPress

By

Deprecated notices in WordPress can be annoying. They clutter your screen and make everything look messy. But don’t worry! There are simple ways to hide them without breaking anything.

What Are Deprecated Notices?

WordPress keeps evolving. New functions replace old ones. When a function is outdated, WordPress warns you with a deprecated notice. These warnings help developers update their code.

For example, if a plugin or theme uses an old function, WordPress will display a notice like this:

Deprecated: Function xyz() is deprecated since version 6.0! Use abc() instead.

If you’re not a developer, you don’t need to see these messages. So, let’s hide them!

Method 1: Edit wp-config.php

The easiest way to hide deprecated notices is by editing your wp-config.php file.

  1. Open your website files using FTP or File Manager in cPanel.
  2. Find the wp-config.php file in the root directory.
  3. Edit the file and look for this line:
define('WP_DEBUG', true);

Change it to:

define('WP_DEBUG', false);

This turns off all debugging messages, including deprecated notices.

Method 2: Hide Only Deprecated Notices

Maybe you want to keep other error messages but hide only deprecated notices. You can do this by adding these lines to wp-config.php instead:

define('WP_DEBUG', true);
define('WP_DEBUG_DISPLAY', false);
define('WP_DEBUG_LOG', true);
error_reporting(E_ALL & ~E_DEPRECATED);

This keeps debugging on but hides deprecated warnings from showing on your website.

Method 3: Use a Plugin

If editing files sounds scary, don’t worry! There’s a plugin for that.

Follow these steps:

  1. Go to your WordPress dashboard.
  2. Click on Plugins » Add New.
  3. Search for WP Debug Toggle or a similar plugin.
  4. Install and activate it.
  5. Configure the settings to hide deprecated notices.

Easy, right?

Method 4: Update Your Plugins and Theme

Deprecated notices usually appear because of outdated plugins or themes. A simple fix is to keep everything updated.

Here’s what to do:

  • Go to Dashboard » Updates.
  • Check if any updates are available.
  • Update your plugins and theme.
  • Refresh your website and see if the notices disappear.

Method 5: Modify Your Theme’s functions.php File

If deprecated notices only appear on the front end (your website pages), you can hide them by adding this code to your theme’s functions.php file:

error_reporting(E_ALL & ~E_DEPRECATED);
ini_set('display_errors', '0');

But be careful! If you switch themes, you’ll have to add this code again.

Should You Hide Deprecated Notices?

Hiding deprecated notices is fine if you’re just managing a website. But if you’re a developer, it’s better to fix the issues.

Deprecated notices exist for a reason. They remind you to update your code before a future WordPress update breaks your site.

Final Thoughts

Deprecated notices can be annoying, but they’re easy to hide. You can:

  • Edit wp-config.php
  • Use a plugin
  • Update your plugins and theme
  • Modify functions.php

Choose the method that works best for you. Happy WordPressing!