Skip to content

Instantly share code, notes, and snippets.

@timmyc
Created April 10, 2020 21:08
Show Gist options
  • Save timmyc/ee0c6f4cb3ed82620efaa16386e62c6b to your computer and use it in GitHub Desktop.
Save timmyc/ee0c6f4cb3ed82620efaa16386e62c6b to your computer and use it in GitHub Desktop.
Set WooCommerce DB Update Notice as Actioned
<?php
/**
* Plugin Name: Remove WooCommerce DB Notice
* Plugin URI: https://woocommerce.com
* Description: Clears out any pending WooCommerce DB Update notices
* Author: WooCommerce
* Domain Path: /languages
* Version: 0.1
*/
function woocommerce_set_database_update_notice_as_actioned() {
// Bail if WoocCommerce notes class is not present.
if ( ! class_exists( 'WC_Notes_Run_Db_Update' ) ) {
return;
}
$woocommerce_notes_db = new WC_Notes_Run_Db_Update();
$woocommerce_notes_db->set_notice_actioned();
}
add_action( 'admin_notices', 'woocommerce_set_database_update_notice_as_actioned' );
@essmeier
Copy link

I'm still seeing the message even though the database field is shown as "actioned."

I've worked around it by adding code to my functions.php file:

`// Remove WooCommerce database update done message

add_action( 'admin_head', 'admin_css' );
function admin_css() {
echo "

<style type='text/css'>.is-alert-update {display: none;}</style>

";
}`

@ciprianpentelescu
Copy link

Easy fix in sql:
update wp_wc_admin_notes SET status='actioned' where name='wc-update-db-reminder';

@smakhalov
Copy link

Easy fix in sql: update wp_wc_admin_notes SET status='actioned' where name='wc-update-db-reminder';

This helped for "WooCommerce database update in progress" message, thanks!

However, I have another one too:
Is there anything similar can be done with "WooCommerce is updating product data in the background" message?

@crishnakh
Copy link

To hide the coupons notices the name on table xx_wc_admin_notes is 'wc-admin-coupon-page-moved' ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment