Back to Top

Create a .pot or .po File using Poedit

Previous Post:

Create a .pot or .po File using Poedit

Poedit1 is an extremely popular Gettext2 catalogs editing tool known for its ease of use and fast speed. Numerous WordPress developers and translators are now constantly using this tool to internationalize and localize plugins and themes.

During such internalization and localization processes, a .pot and .po file are created. They are identical in every aspect except for their purposes. A .pot file is often created by the plugin or theme author himself and then delivered along with that plugin or theme so that translators can translate such project using Poedit conveniently. When a translator finishes his job, a .po and a .mo file will be created and will be eventually used by end-users.

Creating a .pot file (for developers)

After you have downloaded Poedit and installed it, fire the application up and then choose File → New Catalog. You’re now at the ‘Project info’ tab. ‘Project name and version’ should be your plugin’s name, ‘Charset’ and ‘Source code charset’ should be ‘utf-8’. Switch to ‘Paths’ tab and choose to add a new item, as described in the screenshot below:

Add a new pathwp-content/uploads/2011/02/a123-new-path-300x121.gif 300w" sizes="(max-width: 370px) 100vw, 370px" />

Add a new path

Type in a dot (.) to tell Poedit to search for PHP files in the same folder as the .pot file. Next switch to ‘Keywords’ tab, press the same ‘New item’ button and add all Gettext functions you use for your plugin, most of the time only __ and _e are needed. Make sure all necessary functions are added and press OK. Now press File again and save your file in the same folder as your plugin’s main file (i.e. the PHP file that WordPress will use to load your plugin). By default Poedit saves your file as a .po file but since the two files are identical you can get around that by simply choosing to save the .po file as a .pot file:

Save the .po file as .potwp-content/uploads/2011/02/a123-save-as-pot-300x45.gif 300w" sizes="(max-width: 457px) 100vw, 457px" />

Save the .po file as .pot

You can rename the .po file later if you wish. Remember to delete the .mo file created along with our fake .pot file because it is not needed by our translators.

After your .pot file is nicely saved, navigate to Catalog and choose to ‘Update from sources’:

Update .pot file from sourceswp-content/uploads/2011/02/a123-update-from-sources-300x121.gif 300w" sizes="(max-width: 370px) 100vw, 370px" />

Update .pot file from sources

Just sit back and wait for the process to complete. After you press OK the main screen should be filled with strings that need translating from all of your plugin’s PHP files, excellent! The last thing to do is to save the file again and packed it with your project (remember to again delete the .mo file because each time you save the .pot file another .mo file will be created).

Creating a .po file (for translators)

To create a .po file, simply follow these steps3:

.pot File Editting Screen

.pot File Editting Screen

  1. Download and install Poedit if you haven’t done so already.
  2. Download/request a .pot file or create one yourself if the plugin or theme doesn’t supply such file.
  3. Open the .pot file in Poedit.
  4. (See Image on the right) The box labeled (1) is the original message (in English) from the .pot file. The box labeled (2) is where you add your translation. Boxes labeled (3) and (4) are used for adding comments about the messages. These come in handy if you are working with a team of translators and would like to pass around ideas through the .po file.
  5. Go to File → Save as… to save your translations in a .po file. If you do not know how to name it, take a look at this page: The name you should use is the combination of the project’s text domain (locate it inside codes) and a short string in parentheses next to a language’s name (e.g. French – Français (fr_FR)). For example, if the text domain is bwp-minify and the translation is French, just name the .po file bwp-minify-fr_FR.
  6. When you have finished translating, go to File → Save as… again to generate the .mo file. Or you can set your Poedit to always compile a .mo file when saving changes by clicking File → Preferences and on the Editor tab check the Automatically compile .mo file on save box.

Updating a .po (and .mo) file

Another task of a translator is to update a .po file whenever a particular project has just been updated with more strings to translate, or even obsolete ones. To update your .po file, again navigate to Catalog, but this time choose ‘Update from POT file’, and then choose the .pot file from which you would like to get updated contents. Next, translate the project as you would normally do and save all changes.

Now that you’ve known how to create a .po file, i.e. translate a plugin, please consider translating my WordPress plugins. Finished translations should be sent through the contact fom or through a direct email to contact (at) betterwp (dot) net. Thanks!


  1. []
  2. []
  3. ... ith_Poedit []

Take Social Sharing to
the Next Level with Monarch!

Take Social Sharing to the Next Level with Monarch!
Print Article Trackback Trackback to this Article   Subscribe to Comments RSS Subscribe to Comments RSS

25 Opinions for Create a .pot or .po File using Poedit (23 Trackbacks)

  1. User's Gravatar
    Alin May 14, 2015 at 4:43 pm – Permalink

    I did everything you describe above to create a POT file but it’s not working for me… After pressing the update button there is showing a error msg which is >>>>
    — C:\Program Files (x86)\Poedit\GettextTools\bin\xgettext.exe: error while opening “navigation” for reading: No such file or directory
    — Entries in the catalog are probably incorrect.
    — Updating the catalog failed. Click on ‘Details >>’ for details.

    Noe: I think it may be paths related issue. I have a sub-directory “languages” for storing my languages files.
    Can you help me to get out of this situation please. Thanks

  2. User's Gravatar
    Hamid September 16, 2017 at 4:52 am – Permalink

    thanks, very useful for beginner like me.

  1. 13 Best Free Sitemap Plugins For WordPress In 3/2015 - Wordpress, Prestashop, Magento, Drupal, Joomla - Install, Download, Service

    […] help translate this […]

  2. 21 Best Free WordPress Contact Form Plugins In 3/2015 - Wordpress, Prestashop, Magento, Drupal, Joomla - Install, Download, Service

    […] help translate this […]

  3. Modify WordPress Language Files

    […] Create a .pot or .po File using Poedit […]

  4. WordPress - Poedit: Translation Secrets - CSSIgniter

    […] Create .pot or .po file using Poedit […]

  5. Better WordPress Minify - Free Plugins

    […] help translate this […]

  6. WordPress プラグインを国際化するための9ステップ – セルティスラボ

    […] Create a .pot or .po File using Poedit – Better WordPress WordPress Plugin […]

Speak Up Your Mind!

An asterisk (*) indicates a required field and must be filled.

  • Web page and e-mail addresses turn into links automatically.
  • Wrap codes in: <code lang=""></code> or <pre lang="" extra="">
  • Lines and paragraphs break automatically.

Next Post: