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:

woocommerce-custom-order-status-dropdown

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 > 🙂

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!

Articles you may also like:

Posted by Justin Stern

Justin is a cofounder of SkyVerge and a frequent Sell with WP contributor. He loves writing technical reviews and how-to articles, but thinks writing code is far easier than writing words.

14 Comments

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

    1. You could try using something like http://wordpress.org/plugins/ultimate-taxonomy-manager/ to rename the shop_order_status taxonomy terms 🙂

  2. Justin,

    You’re awesome! You just saved me $25 – $49!

  3. 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.

  4. This is a good idea.

    I found a free plugin after all, that does the job. I can give you the link here if you like.

  5. 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.

  6. Mark von Fritschen September 16, 2014 at 3:41 am

    Since Woocommerce 2.2 it isn’t working anymore and the plugin too. Any other ideas?

  7. 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: https://gist.github.com/claudiosmweb/e68e891d593c4c989d9d I put it into my functions.php file. Just replace “Status Name” with your custom status name. 🙂

    1. Hey Anita, thanks for the heads up! We’ll put a notice up and throw an idea up on our Trello board for an updated post 🙂

  8. 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.

  9. Nice one Anita – this worked for me as well!

  10. hii can we add custom order action in order??

It's been over 2 years since this post was published, so comments have been closed. Thanks for reading!