Smart WP-CLI command to cache the Twig templates so they can be read by PoEdit

v1.0.2 2023-11-14 16:06 UTC

This package is auto-updated.

Last update: 2024-02-14 16:43:26 UTC



Parses all Twig files in your current themes templates directory to .php files.


  1. Install package via composer require level-level/clarkson-wp-cli-twig-translations.

  2. Run wp clarkson-twig-translations prepare-files which dumps rendered .php files in a dist directory in your current active theme.

  3. Make sure your PoEdit .pot or .po file configuration loads this dist folder when it updates from source like "X-Poedit-SearchPath-1: dist/rendered-templates\n"


Free PoEdit doesn't scans Twig files. If you do want PoEdit to do this, buy the Pro version.


  • clarkson_twig_translations_cache_path alters the location where to parse to.
  • clarkson_twig_translations_templates_path alters the location where the templates are located in.