WooCommerce Store Notices allow you to set a “start date” for when the banner should appear on your site. But how do you automatically turn that notification bar off?
This tooltip gives you custom code to hide the “Store Notice” at a specific end date and time. Use this method as a simple way to run a “Flash Sale” with access to limited time deals.
The Code Recipe
Adding the Recipe to Your Website
You can add this recipe to your site by creating a custom plugin or using the Code Snippets plugin available for free in the WordPress repository. We have a post on how to create a customizations plugin on our partner website, Paid Memberships Pro.
Modify line 10 of the code recipe for your specific banner end date and time in the format:
Y-m-d H:i:s (i.e.
Leverage The sitewide sales Plugin For More Features
This recipe shows a simple way to hide the WooCommerce Store Notice. If you need more robust sitewide sale banners and notification bars, try the Sitewide Sales plugin—it works with WooCommerce and other popular ecommerce plugins for WordPress.