Website Building » WooCommerce » How Do I Create a Custom Status in WooCommerce?

How Do I Create a Custom Status in WooCommerce?

Last updated on January 18, 2023 @ 6:29 pm

Adding a custom status to WooCommerce is a great way to keep track of important orders, or to provide additional information to customers. There are two ways to add a custom status: through the WooCommerce settings page, or by adding code to your theme’s functions.php file.

To add a custom status through the WooCommerce settings page, go to WooCommerce > Settings > Orders. Then, click on the Statuses tab and select Add New Status. Give your new status a name, and then click on the Add Status button.

If you want to add a custom status via code, you’ll need to add the following code to your theme’s functions.php file:

PRO TIP: If you are not familiar with code or do not feel comfortable editing your theme files, we recommend that you consult with a developer before proceeding. Updating your theme or WooCommerce files could result in your store being unavailable if done incorrectly.
function wc_custom_status() {
    register_post_status( 'wc-custom', array(
        'label'                     => _x( 'Custom', 'Order status', 'woocommerce' ),
        'public'                    => true,
        'show_in_admin_status_list' => true,
        'show_in_admin_order_list'  => true,
        'exclude_from_search'       => false,
        'label_count'               => _n_noop( 'Custom (%s)', 'Custom (%s)', 'woocommerce' ),
    ) );
}
add_action( 'init', 'wc_custom_status' );

Be sure to replace wc-custom with your desired slug for the custom status.

Conclusion:

In conclusion, adding a custom status to WooCommerce is a great way to keep track of important orders or to provide additional information to customers. There are two ways to add a custom status: through the WooCommerce settings page or by adding code to your theme’s functions.

Drew Clemente

Drew Clemente

Devops & Sysadmin engineer. I basically build infrastructure online.