Translates

How to say it in other languages, and what words mean

Spanish

How to Translate a WordPress Plugin (Step-by-Step)

· 5 min read · Spanish

In this article
  1. What You'll Need
  2. Step-by-Step
  3. Common Mistakes
  4. Tips
  5. Troubleshooting
  6. Frequently Asked Questions

Translating a WordPress plugin lets you offer your site in multiple languages without waiting for the developer to release an official translation. This guide shows you how to create or edit translation files (PO and MO) using free tools, so you can localize any plugin—even if you're not a developer.

What You'll Need

  • A WordPress site (local or live) where the plugin is installed and active.
  • FTP access or a file manager in your hosting control panel (to upload files).
  • A text editor like Notepad++ (Windows), TextEdit (Mac), or VS Code.
  • A translation editor—recommended: Poedit (free for desktop) or the browser-based Loco Translate plugin.
  • Your language code (e.g., es for Spanish, fr for French, de for German).

Step-by-Step

  1. Identify the plugin's text domain. In the plugin folder (usually /wp-content/plugins/plugin-name/), look for a .pot file (template) or .po files. The text domain is often the plugin's slug—for example, contact-form-7.
  2. Check for existing translations. Look in the plugin's /languages/ folder. If you see a file like plugin-name-es_ES.po, you can edit that. If not, you'll create a new one.
  3. Create a .pot file (if missing). Use a tool like Poedit to scan the plugin's PHP files. In Poedit: File > New from POT file—if no POT exists, choose File > New and then Catalog > Properties to set the source paths and text domain. Click Update from sources to extract all translatable strings.
  4. Set your language. In Poedit, go to Catalog > Properties and set the language (e.g., Spanish) and country (e.g., Spain) if needed. This will name your file correctly, like plugin-name-es_ES.po.
  5. Translate the strings. In the translation editor, you'll see a list of source strings and empty fields for translations. Fill in each one. Pay attention to placeholders like %s and %d—keep them in the same order in your translation.
  6. Save as .po and .mo. When you save in Poedit, it automatically generates the compiled .mo file. If you're using a text editor, you'll need to compile the .po to .mo using a tool like msgfmt or an online converter.
  7. Name the files correctly. The files must follow the pattern: plugin-name-LOCALE.po and .mo, where LOCALE is like es_ES or fr_FR. If the plugin uses a custom language folder, place them there.
  8. Upload the files. Use FTP or your hosting file manager to upload the .po and .mo files to the plugin's /languages/ folder (or the folder specified in the plugin's code).
  9. Set your site language. Go to Settings > General in WordPress and set Site Language to your language (e.g., Spanish). This makes WordPress load the translation files.
  10. Test the translation. Visit the pages where the plugin appears. If you see untranslated strings, check the text domain or file naming.

Common Mistakes

  • Wrong file naming. Using plugin-name-es.po instead of plugin-name-es_ES.po can cause WordPress to ignore the file.
  • Mismatched text domain. If the plugin's code uses a different text domain than your file name, translations won't load.
  • Forgetting the .mo file. WordPress uses the compiled .mo file, not the .po. If you only upload the .po, nothing changes.
  • Breaking placeholders. Removing or reordering %s and %d can cause errors or missing data in the output.
  • Editing plugin files directly. If you modify the plugin's PHP files to hardcode translations, they'll be lost on update. Always use translation files.

Tips

  • Use Loco Translate plugin if you don't want to deal with FTP. It lets you edit translations directly in the WordPress admin and auto-generates the .mo file.
  • Keep translations consistent with your site's tone. If you're unsure about a term, check how other plugins translate it.
  • For plugins with many strings, work in batches and save frequently.
  • If the plugin is on WordPress.org, consider contributing your translation back to the official language pack—this helps the community.
  • Test on a staging site first to avoid breaking your live site.

Troubleshooting

  • Translations don't appear. Check that the file name matches the locale exactly (e.g., pt_BR for Brazilian Portuguese). Also verify the text domain in the plugin's main file (look for load_plugin_textdomain).
  • Some strings remain in English. The plugin may have hardcoded strings not using the translation function. You can't translate those via files—you'd need to edit the plugin code, but that's risky.
  • Site shows a white screen after uploading. This usually means a syntax error in your .po file. Reopen it in Poedit and fix any formatting issues.
  • Translation works on local but not live. Clear the cache (both WordPress and browser). Also, ensure the file permissions are correct (644 for files, 755 for folders).
  • Plugin update overwrites your translation. To prevent this, copy your .po and .mo files to a safe location and re-upload after updating. Or use a child plugin to load custom translations.

Frequently Asked Questions

Do I need to know programming to translate a plugin?

No. Translation files are just text. Tools like Poedit make it easy, and you don't need to touch code.

What's the difference between .po and .mo files?

The .po file is the human-readable source (with original and translated strings). The .mo file is the compiled, machine-readable version that WordPress actually loads.

Can I translate a plugin that doesn't have a .pot file?

Yes. You can create a .pot file by scanning the plugin's PHP files with Poedit or Loco Translate. The tool will extract all strings marked for translation.

Will my translation be lost when the plugin updates?

Yes, if you place files inside the plugin folder. To avoid this, use a separate custom language folder or a plugin like Loco Translate that stores translations in wp-content/languages/plugins.

How do I find the text domain of a plugin?

Open the plugin's main PHP file and look for load_plugin_textdomain( 'text-domain', ... ). The first argument is the text domain.

Can I translate a premium plugin?

Yes, but check the license. Some premium plugins allow translation; others may restrict it. You can still create translation files for personal use, but distributing them may violate terms.