Skip to main content
WordPress made easy with the drag & drop Total WordPress Theme.Learn More

Create WooCommerce Custom Order Statuses For WordPress

April 29, 2018

WooCommerce is an awesome WordPress plugin to sell products online. And today I’d like to show you how to create plugin to allow you to create custom order statuses. By default WooCommerce provides these order statuses:

  • cancelled
  • completed
  • failed
  • on-hold
  • pending
  • processing
  • refunded

But what if you want to add new statuses, or maybe modify existing ones? Below is an example showing you how easy it is to add a new order status to your WooCommerce orders.

Visually here is the final result:

woocommerce-custom-order-status

Register New WooCommerce Order Status

Previously WooCommerce used a “shop_order_status” taxonomy so adding new order statuses was a bit tricky, however, now it’s easier then ever! Have a look at the code below for an example.

// Register New Order Statuses
function wpex_wc_register_post_statuses() {
	register_post_status( 'wc-custom-order-status', array(
		'label'						=> _x( 'Custom Order Status Name', 'WooCommerce Order status', 'text_domain' ),
		'public'					=> true,
		'exclude_from_search'		=> false,
		'show_in_admin_all_list'	=> true,
		'show_in_admin_status_list'	=> true,
		'label_count'				=> _n_noop( 'Approved (%s)', 'Approved (%s)', 'text_domain' )
	) );
}
add_filter( 'init', 'wpex_wc_register_post_statuses' );

// Add New Order Statuses to WooCommerce
function wpex_wc_add_order_statuses( $order_statuses ) {
	$order_statuses['wc-custom-order-status'] = _x( 'Custom Order Status Name', 'WooCommerce Order status', 'text_domain' );
	return $order_statuses;
}
add_filter( 'wc_order_statuses', 'wpex_wc_add_order_statuses' );

If you want to add multiple new order statuses simply duplicate the register_post_status function inside the wpex_wc_register_post_statuses function as many times as you want making sure to alter the ID and the labels accordingly. Then add the new order status to the $order_statuses array in the wpex_wc_add_order_statuses function.

woocommerce-order-status
Article by AJ Clarke WPExplorer Staff
Published on: August 20, 2013
Last updated on: April 29, 2018
Subscribe to the Newsletter

Get our latest news, tutorials, guides, tips & deals delivered to your inbox.

44 Comments

  1. emyr says:

    I believe the purpose of the “show_in_nav_menus” parameter is for making the taxonomy terms available in the “Appearance > Menus” screen, so that you can add links to term archives in a custom menu.

    • AJ Clarke | WPExplorer says:

      Yes, that is what “show_in_nav_menus” does…maybe it has something to do with the fact that the terms are being added directly to the WooCommerce filter?

      • werm says:

        Any idea how to get these custom order statuses into the WooCommerce » Orders Bulk Edit Dropdown? It really is the only thing holding this plugin back from being effective! Great plugin otherwise!

  2. Remi says:

    yes, that’s correct

  3. tienlp says:

    after instaling it i couldn’t find the option page, is there anything wrong ?

    I’m currently using WC 1.6

  4. Carlos says:

    I want to buy the theme Blocky but no email contact with you for doubts

  5. kentzo says:

    simple and clean plugins, works great! I used this together with Twilio SMS woocommerce plugins with simple hack to send automated sms based on new created order statuses.

  6. Doug Smith says:

    I added a re-opened status a while back to mark orders that have issues we’re dealing with. It’s been very handy.

    One thing to note is that since any new status gets stored as a term for the existing WooCommerce taxonomy, this plugin can be removed if you don’t need to make any more changes and the new status will remain.

  7. sailingsmitty says:

    Will this plugin give the option in the WooCommerce Email settings (or elsewhere) to send an automated email to a customer once the order status has been updated? Thanks.

    • AJ Clarke | WPExplorer says:

      The code only shows you how to create the custom statuses. Email integration would require further development.

  8. Travis says:

    Awesome plugin! Anyone know how to add custom order status icons?

  9. bloorchi says:

    Hi
    What if you want order statuses to have custom ordering. say to add “handed to delivery” status between “processing” and “completed”.

  10. Keith Pickett (@KeithPickett) says:

    Is there a way to set the default order status to “processing” automatically after the order is placed? I can’t seem to find that in settings. I want to disable it from automatically moving the order status to cancelled if at all possible.
    Thanks!

  11. David Woodthorpe says:

    Thankyou for the very handy plugin – I am trying to develop a quote / invoice system for my business and have managed to customise the my account page and add payment links to unpaid invoices but cannot work out how to allow these to be paid (when clicking the “pay” link the checkout always shows the invoice as already paid) – do you know where I should be looking to edit this behaviour?

    Thankyou for any help you can provide.

  12. emcyze says:

    Hello,

    What is the filter for adding this custom status to the bulk action status list ?

    Thanks and regards

  13. werm says:

    Running WooCommerce 2.0.20, not seeing the custom order status from the dropdown menu on the order edit.php screen.

    I downloaded and ran the plugin directly, is there something I’m missing?

  14. werm says:

    More along the same lines as emcyze has asked: how do I get the custom order status to show in the bulk edit list on the aforementioned “edit.php” for orders in the admin?

  15. jeff1026j says:

    I also want to ask, can I get the custom order status to show in the bulk edit list on the aforementioned “edit.php” for orders in the admin?

  16. Yuri K. says:

    Thanks for plugin and tutorial!

  17. leroy says:

    Hello,

    is it possible to call two action hooks for the Order status. ?

    I mean my plugin file contains actions for woocommerce_order_status_processing hook, that has some function. Now I have also included woocommerce_order_status_pending hook, that does the same function as processing hook .

    Processing Hook works fine for all the orders carried using Card /master card etc , but not when a user does a transaction using PayPal. Where my paypal orders are by default set to Pending in the back-end.

    My query is that can there be two order Hooks defined in a custom woocommerce plugin file ?? . Or there is something else that I may be missing here ??

    Any suggestions would be of a great help.

    Thanks

  18. Dwaynne says:

    Remy, is it possible to allow the customer to cancel his/her order from their My Account page? I have been trying to figure out how to do it via custom order status, but no dice.

  19. ihtsham says:

    you guys are so great & nice! thanks for plugin.

    one quick question: is there any way/plugin to send an automated email to a customer once the order status has been updated?

  20. Brian Hanrahan says:

    Hi, I just installed and get an error of “Invalid Taxonomy” when I click on the “order statuses” link, running Woocommerce 2.2.4. Any ideas?

  21. Wayne Hesler-Mondore says:

    I get an INVALID TAXONOMY

  22. Kamil says:

    Hi,
    Nice Post, Thanks for your post. I have downloded your plugin and activated it but your plugin is not working for me.
    When I click on the menu “Order Statuses” in the admin panel, it shows an error msg “Invalid taxonomy.

    Please solve the issue asap.

  23. Monique says:

    Hi! I am in need of precisely this functionality, but when I installed the plugin and went to the menu, it says “invalid taxonomy” Do I need to mess with the code as explained above, or the plugin was supposed to give me a UI where I’d add the customer order status I wanted?
    Thanks you for your help! M

    • AJ Clarke says:

      Unfortunately they have removed the order statuses taxonomy in WooCommerce 🙁

    • Jeff says:

      AJ is right – you’ll have to create a plugin or add some code to your theme functions.php to get this working:

      [code]
      /*
      * Add some custom order status
      */
      add_filter( 'wc_order_statuses','add_wc_order_statuses', 9,1 );

      function add_wc_order_statuses( $order_statuses ) {

      $order_statuses['wc-approved'] = _x( 'Approved', 'Order status', 'woocommerce' );
      return $order_statuses;

      }

      // register a custom order status it so we can see it in admin
      register_post_status( 'wc-approved', array(
      'label' => 'Approved',
      'public' => true,
      'exclude_from_search' => false,
      'show_in_admin_all_list' => true,
      'show_in_admin_status_list' => true,
      'label_count' => _n_noop( 'Approved (%s)', 'Approved (%s)', 'woocommerce' )
      ) );
      [/code]

  24. Monique says:

    Thank you AJ and Jeff for your reply!

  25. Clare says:

    i have the plugin installed and added the code to my functions.php but still get invalid taxonomy – any ideas?

  26. chris says:

    How can I list all orders with a specific status on a page?

  27. T.McDermaid says:

    AJ,

    Can you look at my code and tell me what I am doing wrong? I have tried to add more than one “Order Status” references which isn’t working:

    • AJ Clarke says:

      Could you please post your code on Gist and then show me the link? When submitted through the comment form the formatting gets all messed up so I can’t really read it clearly.

  28. Marty says:

    Great Post 🙂

    I’ve successfully added a custom order statsus.

    Any orders with this type are now missing off the sales reports, any idea on how hey can be added to the sales report?

    Thanks in advance for your help?

  29. Luis says:

    Hi.. This code is great!!!. However, it does not maintains the status when I upgrade it. How can I do to solve this ?

    • Kyla says:

      What do you mean by “upgrade it”? Are you referring to a recent WooCommerce update and the code isn’t working for you anymore?

Leave a Reply

Your email address will not be published. Required fields are marked *