Skip to content

Woocommerce Subscriptions – Change status labels

Very often, users have a certain way of operating. Within that operations, terminology is very important to them to help them identify their processes. With out-of-the-box software you’re given a terminology that’s been decided for you which, although possibly correct, can cause confusion to the people administering the software.

As developers, changing a few terms to suit the clients terminology can help to reduce confusion and queries.

Here is a way to change the subscription status terms in WooCommerce subscriptions. We have a couple of handy hooks we use for this. wcs_subscription_statuses modifies the status options when editing a subscriptions and woocommerce_subscriptons_registered_statuses modifies the output in the table view listing the subscriptions.

/*
 * Change Subscription Status Terms
 */
function woo_subscriptions_change_statuses( $subscription_statuses ) {
    $subscription_statuses['wc-active']     = _x( 'Current',    'Subscription status', 'woocommerce-subscriptions' ); // Was Active
    $subscription_statuses['wc-expired']    = _x( 'Lapsed',     'Subscription status', 'woocommerce-subscriptions' ); // Was Expired
    $subscription_statuses['wc-cancelled']  = _x( 'Resigned',   'Subscription status', 'woocommerce-subscriptions' ); // Was Cancelled
    return $subscription_statuses;
}
add_action( 'wcs_subscription_statuses', 'woo_subscriptions_change_statuses', 0 );
 
function woo_subscriptions_change_statuses_admin( $subscription_statuses ) {
    $subscription_statuses['wc-active']     = _nx_noop( 'Current <span class="count">(%s)</span>',  'Current <span class="count">(%s)</span>',  'post status label including post count',   'woocommerce-subscriptions' );
    $subscription_statuses['wc-on-hold']    = _nx_noop( 'Lapsed <span class="count">(%s)</span>',   'Lapsed <span class="count">(%s)</span>',   'post status label including post count',   'woocommerce-subscriptions' );
    $subscription_statuses['wc-cancelled']  = _nx_noop( 'Resigned <span class="count">(%s)</span>', 'Resigned <span class="count">(%s)</span>', 'post status label including post count',   'woocommerce-subscriptions' );
    return $subscription_statuses;
}
add_action( 'woocommerce_subscriptions_registered_statuses', 'woo_subscriptions_change_statuses_admin', 0 );

Also, you can remove statuses very simply by unsetting the array keys.

function woo_subscriptions_change_statuses( $subscription_statuses ) {
    unset($subscription_statuses['wc-on-hold']);
    unset($subscription_statuses['wc-pending-cancel']);
    return $subscription_statuses;
}
add_action( 'wcs_subscription_statuses', 'woo_subscriptions_change_statuses', 0 );

About 

10 years + experience in web development working with lots of different technology.

Published inPHPWooCommerceWordPress

2 Comments

  1. Alvaro Alvaro

    Nice one! Thank you very much.

    There is a way to change the word Subscription for Plan in the all the frontend? Thanks

  2. Andrej Andrej

    Thank you! Have you also a tip for creating a custom subscription status? How do I accomplish this?

    Thank you!

Leave a Reply

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