How to create a pot file for your theme or plugin

April 10, 2016

This method described here does not work anymore. Please check our newest article: How to generate a pot file for a WordPress theme using a plugin.

So you got a new theme that is already localized, or want to submit a free theme to WordPress.org. How do you go about creating the .pot file?

POT stands for Portable Object Template and is a template file that contains references to all parts of your theme or plugin that need translating.

In this article we will explain how to create a .pot file using the WordPress i18n tools, this means that these tools use code from WordPress core and it is the best way to generate a .pot file as it makes also text like theme name or description in style.css file translation ready.

I will be using the Terminal in a Mac for doing this, but in PC should be the same. Open your Terminal and first we need to do an SVN checkout of http://develop.svn.wordpress.org/trunk/

svn co http://develop.svn.wordpress.org/trunk/ wpdev


you could do this with an SVN client as well, but the above is pretty easy.

After that change the directory to i18n tools directory

cd wpdev/tools/i18n/

Next you need to run makepot.php file over your theme’s directory

php makepot.php wp-theme /path/to/your/theme themename.pot


The new .pot file is created and be found inside the i18n directory. Just copy and paste it inside the languages folder of your theme.

To create a .pot file for your plugin, just change the above code like this

php makepot.php wp-plugin /path/to/your/theme pluginname.pot

Most of our themes are localized and .pot file is provided, check them out.

One comment

  1. Thanks for the references, it worked as expected.

Leave a Reply to Mr Alexander Cancel reply

Your email address will not be published. Required fields are marked *