Need help? Book our fixed price WordPress Support service.

Change WooCommerce “Related Products” Text

Changing the “Related Products” text in WooCommerce 4 requires a small piece of code. Add this into your theme functions.php file, changing “Your Custom Text Here” to whatever you want:

add_filter( 'gettext', 'wtd_related_products_text', 20, 3 );
function wtd_related_products_text( $translated_text, $text, $domain ) {
switch ( $translated_text ) {
case 'Related products' :
$translated_text = __( 'Your Custom Text Here', 'woocommerce' );
break;
}
return $translated_text;
}

Was this article helpful?

No 0

About the Author

Christian Mayne is a full time WordPress developer and consultant based in the UK. He runs a UK based WordPress development agency with clients all over the World. As well as WordPress development, Christian has been teaching WordPress use and development since 2014 in classroom settings and online.

LEAVE COMMENT