»  Knowledgebase  »  WooCommerce  »  Change WooCommerce “Related Products” Text

Change WooCommerce “Related Products” Text

by | Mar 26, 2020 | 0 comments

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

Code

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;
}

0 Comments

Submit a Comment

Your email address will not be published.

UK WordPress Support

We are a team of UK based WordPress experts offering WordPress help & support, WordPress site management and maintenance, content management services, one to one WordPress training and consultancy.

Need to chat? Contact Us Now!

WordPress Maintenance

Let us manage your plugin and theme updates, keep your WordPress website site running smoothly and your visitors happy!

WordPress Care Plans
from just £35 / month!

One to One WordPress Training

We provide one to one WordPress training to individuals and companies all over the World!

Whether you are developing new skills for business or working on a personal project, we can support you, and your first trial session is free!

Book an initial WordPress Orientation Session

Get the WordPress Management Guide

Get the WordPress Management Guide

Sign up to our newsletter to receive our insider guide to managing WordPress in [currentyear], free to your inbox.

You have Successfully Subscribed!