How to change the “SKU” label used to identify products in WooCommerce

First method – PHP.
The following code must be inserted in the function.php contained in your child theme (**).
/* This code change the SKU label for all Woocommerce products */
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;
}
Second method – using a custom MO file
While a PO file is a text file and is easy for humans to read, his equivalent MO files are compiled and are easy for computers to read.
Your WordPress web server will use the MO file to display the translations.
This method uses a custom MO file as proposed by Damien Carbery and it can be found here:
https://www.damiencarbery.com/2018/12/change-hardcoded-woocommerce-strings/
(**) How to Create a Child Theme
A child theme is a theme that inherits the functionality and styling of another theme, called the parent theme. Child themes are the recommended way of modifying an existing theme.
- Create child theme directory (common approach to name child theme as the parent theme plus -child added on the end.)
- Create style.css
- Create functions.php
For more detailed instructions on child themes you can visit the following links:
https://developer.wordpress.org/themes/advanced-topics/child-themes/
https://blog.hubspot.com/website/wordpress-create-child-theme