logomichael sumner
Contact

Remove WooCommerce Admin Notice for Outdated Theme Template Files

Are you a theme developer and might not want to always have to get the WooCommerce admin notice being displayed for your clients websites?

You can make use of the following snippet to hide the outdated template notice.

Reasons to Use This Snippet

Why would you want to do this? Here are a few reasons why you might want to hide the oudated WooCommerce theme template files notice:

  • You regularly maintain the active WooCommerce theme, and provide monthly maintenance for your clients.

  • The outdated template notice is too distracting for your clients.

  • This causes a shock for your clients, even if you inform them that you perform thorough and tested maintenance updates, at a specified recurring time period

Here is the snippet below:

/**
 * Remove WooCommerce Admin Notice for outdated theme template files.
 *
 * We are using a custom theme, so it is bound to be out of date pretty quickly.
 * And we would like to keep the @since to keep track of it.
 * 
 * You can always visit the WooCommerce › Status
 * to view the outdated theme template files.
 *
 * @return void
 */
function wc_remove_admin_notice_template_files() {
    if ( class_exists( 'WC_Admin_Notices' ) ) {
        WC_Admin_Notices::remove_notice( 'template_files' );
    }
}
add_action( 'admin_init', 'wc_remove_admin_notice_template_files' );

The benefit is that you will still receive the outdated files notice, as a developer, within the WooCommerceStatus page. And you can still not have to deactivate this snippet hook at all.

I hope you like the snippet, now that you will not receive the outdated theme template files notice.

Enjoy, and happy WooCommerce coding!