Creating a WooCommerce Custom Order Status

This code works for versions of WooCommerce up to 2.1.12. WooCommerce 2.2 changed the order status structure, which means this won’t work. This updated post will work for WooCommerce 2.2+ instead.

Adding your very own custom order statuses to WooCommerce is both fun and easy. When you first install WooCommerce, it automatically adds 7 order statuses: Pending, Failed, On-Hold, Processing, Completed, Cancelled, and Refunded. These statuses are fairly universal and should be sufficient for the majority of shops, but certain businesses are going to have an order fulfillment process with additional steps, or one that just doesn’t quite fit the usual mold.

Thankfully one of the guiding philosophies behind WooCommerce, and a driver of the explosive growth it’s exhibited, is to make things “just work” right out of the box for the majority of folks, while allowing easy customization for when something just doesn’t quite fit your needs.

So, without further ado, your own WooCommerce custom order status can be created by calling the WordPress function wp_insert_term() like so:

wp_insert_term( 'Assembling', 'shop_order_status' );

To actually add our custom order status, call that function from the WordPress ‘init’ action by adding the following to your theme’s functions.php:

add_action( 'init', function() {
wp_insert_term( 'Assembling', 'shop_order_status' );
} );

Then load any page in your WordPress admin, and your shiny new order status will be ready for use:

This action/function only needs to be run once to add a new status. Though it won’t hurt anything to have it run additional times, there’s no need to do so, and it should be removed from your functions.php file once you’ve verified your new status was created.

Removing a Status

If you start having second thoughts about a custom order status you’ve added, it’s a simple matter to get rid of it using the WordPress wp_delete_term() function. You’ll first need to look up the status term id:

add_action( 'init', function() {
$term = get_term_by( 'name', 'Assembling', 'shop_order_status' );
if ( $term ) {
wp_delete_term( $term->term_id, 'shop_order_status' );
} );

Again, put this in your theme’s functions.php and load a page in the admin. Like the order status creation code, this only needs to be run once, so remove it once you’ve verified the custom order status is gone.

Taking it Further

Once your custom order status is added, you can extend the functionality of your simple status. Perhaps you want to dispatch an email when the custom status is set on an order, and can do this by using some of the numerous order status hooks provided by WooCommerce.

< begin shameless plug > Not comfortable tweaking this code yourself? For those looking for this sort of functionality combined with the ease of use of an administrative interface, there’s an upcoming Order Status Manager to be released in the WooThemes store within the next month or two (from SkyVerge, our parent company at Sell with WP). We’ll link to that plugin once it’s available. < /shameless plug > smile

Until then, if you use these techniques to create your own WooCommerce custom order status, let us know what order status you’ve created with a comment below!


  1. Hey buddy , very useful article ….
    Please tell me how to rename the existing woocommerce order status??

  2. Hi there. I just added your code to my functions.php. It worked and I added the status “approved”. The problem is that every time I refresh the order an “approved” status is added. So I end up with many “approved” orders. Am I doing something wrong? Should I put the code somewhere else and not to functions.php?

    Thank you :)

    1. Hmm, when I first tested this it seemed that it didn’t matter if the wp_insert_term() function was called multiple times, but if this causing duplicate status to be added for you, I’d recommend removing that code and deleting all but the first one that was added.

  3. Christina, Please share the link. it’d be a great help. I am looking to ad a couple of additional statuses like Shipped, COD Confirmed and also send emails to users for these status changes.

  4. Christina, that plugin doesn’t work with WooCommerce 2.2. The tip on this blog post doesn’t work either.

    Turns out WooCommerce 2.2 order statuses are saved as a post status, NOT as a taxonomy. None of the workarounds pre-2.2 will work because of this.

    This worked for me: I put it into my functions.php file. Just replace “Status Name” with your custom status name. :)

  5. Just to let you know that even the plugin I bought for status order and emails didn’t work for woocommerce 2.2, so I believe it’s a good idea to downgrade to 2.1 and wait until the plugins’ developers fix this.

<em>Hmm, looks like this article is quite old! Its content may be outdated, so comments are now closed.</em>