Change WooCommerce SKU text to another label

You can change WooCommerce SKU text to another label using the gettext filter

add_filter('gettext', 'translate_woocommerce', 10, 3);
/**
 * Change SKU Label
 * @link https://gist.github.com/dannyconnolly/da6f1a2d95dc826ccdcd
 * @since 1.0.0
 */

function translate_woocommerce($translation, $text, $domain) {
   if ($domain == 'woocommerce') {
        switch ($text) {
            case 'SKU':
                $translation = 'Catalogue No:';
                break;
            case 'SKU:':
                $translation = 'Catalogue No:';
                break;
        }
   }
    return $translation;
}

So in the above snippet which goes in your functions.php file, any instance of ‘SKU’ or ‘SKU:” will get changed to “Catalogue No:”, change the translation text to suit.

4 Comments

  1. Jim on July 29, 2023 at 4:46 pm

    Works on admin pages, but the actual product page that the end-user sees still displays SKU?
    Using Carnival Lite theme if that makes a difference.

  2. Scott on January 8, 2023 at 9:26 am

    Your snippet above is missing the last part:


    add_filter('gettext', 'translate_woocommerce', 10, 3);

    Then it works

  3. Doug on April 21, 2022 at 2:48 pm

    This is great! Is there a way that you know of to change the text that displays before a variable product option is chosen? Right now before my customers choose an option they see N/A. I would like to change that to “Select option”

  4. Bas on April 19, 2021 at 9:57 am

    Nice! Works great

Leave all Comment