On a single product page, WooCommerce will display related products from the same category at the bottom.

Cloudways

For that, it uses a default text, which is “Related products”.

woocommerce related products text

Unfortunately, there’s no built-in option to change that text. But, luckily, there’s a solution, and I’ll show it to you!

Cloudways

Change “Related products” Text in WooCommerce

I recommend backing up your functions.php file or the entire website! I also recommend using a child theme, otherwise, all the changes will be lost with the next theme update.

If you don’t have a child theme, you can use the Code Snippets plugin to add the code there.

For this tutorial, I’ll be using the functions.php file from a child theme and cPanel.

Cloudways

Step 1

You’ll need to access your WordPress site’s files to edit the functions.php file.

Normally, the file can be found in:

public_html/wp-content/theme/YourThemeName-child/functions.php
edit functions.php cpanel
Editing functions.php via cPanel

Step 2

Cloudways

Add the following code at the very bottom of the file or right above the ?> ending tag (if there’s any).

// Change WooCommerce "Related products" text

add_filter('gettext', 'change_rp_text', 10, 3);
add_filter('ngettext', 'change_rp_text', 10, 3);

function change_rp_text($translated, $text, $domain)
{
     if ($text === 'Related products' && $domain === 'woocommerce') {
         $translated = esc_html__('Check out our other products', $domain);
     }
     return $translated;
}
change woocommerce related products text in functions.php

Final Step

Change the Check out our other products text between the single quotes with whatever text you want.

Leave everything else as is.

change woocommerce related products text in functions.php

The “Related products” text should now be changed.

changed woocommerce related products text

If the Text Doesn’t Change

1. If you refresh the product page and nothing happens, clear your browser and site cache.

A site’s caching system can come from different (even multiple) places: server, plugins, theme, CDN, page builders.

So, make sure you clear them all until the change appears.

2. Some WordPress themes come with built-in support for WooCommerce.

This means that they might have their own custom code for WooCommerce, which might prevent the above code to work.

In that case, you should consider contacting the theme developers and ask for help.

3. Some plugins might prevent the code to work as well.

If you have any WooCommerce related plugins, disable them, clear the caches, and check the product page.

If you’re using a translation plugin, use that to change the “Related products” text, not the code.

That’s a Wrap

I hope you found this tutorial useful and the solution worked for you!

If you have any questions or thoughts, drop a comment or send a message via contact or Facebook page.

You can also hit the follow button on Twitter and subscribe to the YouTube channel.

Don’t forget to share the post to help out others!