Change texts in WordPress without touching the code!

·

 

Last Updated: [last-modified]

Want to change a label or wording of a WordPress plugin or theme? Want to whitelabel the entire WordPress environment for your client? This tutorial is for you!

In this post, we will learn how to change any text within the WordPress environment without touching any code!

Why do I need to change the wording?

Sometimes you might not be happy with the wording available in WordPress or in a theme or plugin and might want to change it. The first idea that comes to our mind is: search for that string and edit, right?

This is really a bad idea! Because each time the theme or plugin gets updated, you lose all the edits. If you just need to change some text or lable to make them more understandable and clear to your user, then using the language file is the best way. If you are using any other language other than English (United States), then you don’t need to read the post. Because you are already familiar with the translation process and happy with the texts.

This tutorial is only for those people who want to change the texts for the same language; in 99% case English (Unites States). Because you might not like the language of non-native theme or plugin developer.

Okay. Where should I start?

If you want to change a text in a theme, then the place you should look for is

wp-content/themes/YourThemeFolderName/languages/

And for plugins, the location is

wp-content/plugins/YourPluginFolderName/languages/

If you can not find a folder named languages inside your desired plugin, then you may find something named i18n. Inside that folder there should be a file similar to the plugin name and the extension should be .po or .pot.

In WooCommerce, the language file is located at /wp-content/plugins/woocommerce/i18n/languages/ and the filename is woocommerce.pot

  1. Open that file using a Gettext editor program. I prefer Poedit. Because it’s free and supports all the major operating systems. You can use any other software or WPML String Translate if you want.
  2. Find and edit the strings you want.
  3. Save the file on your preferred language. The editor will save two files with .po and .mo extension.
    If your language is English (United States), the file name for WooCommerce should be woocommerce-en_US.po and woocommerce-en_US.mo

Now upload the files in the same location on your live server using your favorite FTP client or cPanel and you’re done.

 

If you get confused and need more detailed instructions, feel free to let me know in the comment section 🙂

Comments

Leave a Reply