How to unset WooCommerce order actions

If you’ve ever gotten down to business with WooCommerce, you’ll know how flexible that beast can get. Of course, the flip side to that is how gnarly things can get in there as well but I guess that’s the double-edged sword we live with when building complicated things out of WordPress.

One little handy point of extension is the ability to customise the available order actions when editing an order. If you’re not entirely sure what I’m talking about, here’s a screenshot:

The WooCommerce order actions meta box

This ships with a bunch of order actions by default and they’re all relatively handy but it’s not uncommon for me to come up against situations where I don’t need them all there.

How to remove the default WooCommerce order actions…

It’s a really simple little snippet as you can see below. The filter receives an associative array of action/title pairs so you can unset them as per this example or you could even rename them if you want to.

One last thing…

If you liked this article, I'd be incredibly grateful if you tweeted about it.

Also, I don't send emails often but when I do, I try to fill them full of useful goodies. If you like code snippets & dev tips, join my mailing list. There's no catch but I'll probably want to tell you about any new plugins & tools I build.