Phil Kurth
/ Tips /

How to unset WooCommerce order actions

Last updated • 18 July 2023

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:

<?php

add_filter( 'woocommerce_order_actions', function ( $actions ) {
	
    	// Unset whatever actions you don't need available in the
    	// WooCommerce order edit screen.
	unset( $actions['send_order_details_admin'] );
	unset( $actions['send_order_details'] );
	unset( $actions['regenerate_download_permissions'] );
	
	return $actions;
}, 20 );

Need a website?
Let's talk.

From website design & SEO through to custom WordPress plugin development. I transform ideas into dynamic, engaging, and high-performing solutions.

Phil Kurth, web designer and developer in Geelong