How to pause ordering on a WooCommerce site.

As a WooCommerce store owner, there may come a time when you need to halt ordering on your site temporarily. Perhaps you’re running low on stock, need to perform maintenance on your site or you’re closing your virtual doors for good and need to end sales (💔).

There are several different options for handling this, and we prefer the simple, code-based approach. If you’re not technically inclined, some plugins can handle this for you, including Woo Store Vacation. We won’t go into the intricacies of using that plugin, but their documentation is helpful.

The approach we recommend is dead simple but does require making a change to your theme. If you’re comfortable editing code, you’ll need to add this to your functions.php (or elsewhere if you’re fancy and know where to put it in your codebase):

add_filter( 'woocommerce_is_purchasable', '__return_false' );

Seriously, that’s it. As the filter implies, once implemented, nothing is purchasable. This will hide the “Add to Cart” buttons on every product. You may also want to add a store notice or display something that indicates to customers that your site is taking a break, under maintenance, or otherwise unavailable.

That can be easily done in the customizer:

Dashboard > Appearance > Customize > WooCommerce > Store Notice

Add some text, and the people will be informed.

And that’s it! With that, you can pause ordering on your WooCommerce site. Remember to comment it out or remove it when you are ready to start accepting orders again.

Go forth and sell nothing!

Looking for hosting? We highly recommend WP Engine.