How to Change Any Text in WordPress – Core, Plugin and Theme

I haven’t ever found someone who wants to change the texts of WordPress core. But most of the developers does not like the wordings found in a theme or plugin. Even an UX researcher might want to change some text for the users to have better understanding of the features.

If you don’t know about translations, you might go for changing the source code. But that is not a good practice! Because, the changes will be lost upon update and if you do not know the other way, you will end up editing the source over and over again! So the question is, “what is the best practice, which will save me from banging my head on the wall each time there is an update?”

The best practice for translations

Wait, why am I mentioning translation here?

For those who have never worked with WordPress translation or internationalization, it is a process which does not involve touching source code and the safest place to keep your text for ages. If you already know about translating a theme or plugin, please skip this section and move on to the next paragraph.

Most of the plugin and theme authors put their language file inside the .zip file. The translations work from there too and the location is like wp-content/plugins/pluginName/languages/.

The translation file type will be POT or PO and the file extension would be .po or .pot. You can open that file using Poedit, or use a plugin like WPML or qTranslate. I will be using Poedit; because it is works on all the major operating system, free and easy for all kind of users.

Download and install Poedit and open the .po or .pot file. Change the texts you want and hit save the translations. Upon save, Poedit will generate an extra file, which is MO and the extension would be .mo. That is a machine readable file and WordPress will read that to replace the texts in the system.

So we can put that file in the very same location where is the plugin is located. Like wp-content/plugins/pluginName/languages/. But doing that is equally harmful as editing the source code. Because this file will be erased upon update.

How to Make the Change Update Proof?

If we place the translation file inside the `wp-content/languages/plugins/` then it will be update proof and will stay there as is till the end of time.

If can not find the `wp-content/languages/` folder. Don’t worry, it will not be there by default. You have to create it manually.

I have modified some texts of a plugin named WP User Frontend so the file location is wp-content/languages/plugins/wpuf-en_US.mo. Here, wpuf is the text domain of the plugin.

So this is it. Let me know if have successfully completed the job. If you get confused in between any step, and need more clarification from me. Feel free to let me know in the comments section 🙂

How I write promotion mails

In this post, I have mentioned how I work with promotion mails. If you do not know what is a promotion mail or  a newsletter, you should have a look at the resources section I have mentioned below.

You may know that currently I am working for weDevs Limited, famous for frontend based plugins especially their marketplace plugin Dokan. Often I have to write mails to the customers and subscribers to inform about our latest products, services, discount offer and important blog posts. weDevs use one of the best newsletter plugin MailChimp to manage their campaigns.

Read More

How to create an app on Facebook

In this tutorial, I am going to list the steps to create a Facebook app from scratch and be real quick with that. It is simple and will not take more than 5 minute.

Go to https://developers.facebook.com/

developers.facebook.com home page

Login with your Facebook credentials. After logging in, you will get a menu named “My Apps” on top bar. Hover over that and you will see a link to create “add a new app”. Click on that.

Read More