Support Log in
All Features: Translate WordPress with AI

WP-CLI Commands for Multilingual WordPress Management

If you manage WordPress sites at scale — agencies, developers, DevOps — you spend most of your time in a terminal, not in wp-admin. Lang Forge ships a full suite of WP-CLI commands so every action you can take in the admin UI has a scriptable equivalent.


Why WP-CLI matters for multilingual sites

  • CI/CD pipelinespull translations as part of a deploy, validate string coverage before shipping a new feature
  • Bulk operationstranslating a thousand posts one at a time in the browser is painful; wp langforge translate --all --lang=de is one command
  • Automationagency teams set up nightly cron jobs to populate translation memory, export XLIFF, or check for outdated translations
  • Scriptingshell scripts that set up a brand-new multilingual site in one pass

The 11 commands

Status and inspection

wp langforge status

Prints overall translation status: languages configured, posts per language, translation progress percentage, outdated translations, and AI credit usage.

wp langforge status --lang=de --post-type=product

Filters the status output by language and post type.

Translation

wp langforge translate <post-id> --lang=de --ai

Translates a specific post into the target language. The --ai flag routes through the AI pipeline; without it, the post is duplicated as an untranslated draft.

wp langforge translate --all --lang=de --ai

Translates every published post into German using AI. Shows a cost estimate before running and asks for confirmation (bypass with --yes).

Export and import

wp langforge export --lang=de --format=xliff --output=translations.xlf

Exports all content for a given target language as XLIFF 1.2.

wp langforge export --lang=de --format=csv --output=translations.csv

CSV format for simpler workflows.

wp langforge import translations.xlf

Imports translations from an XLIFF or CSV file. Auto-detects format from file extension.

Translation memory

wp langforge tm-populate

Scans all existing translated posts and populates the translation memory. Useful after migrating from another translation plugin or after importing a large batch of content.

wp langforge tm-search "Buy now" --source=en --target=de

Searches the translation memory for a string and prints matches with similarity scores.

Glossary

wp langforge glossary-import glossary.csv

Imports glossary entries from CSV.

wp langforge glossary-export glossary.csv

Exports the current glossary to CSV.

Site duplication

wp langforge duplicate --lang=de --ai

Duplicates the entire site into a new language and optionally runs AI translation in the background. Equivalent to the one-click duplication feature in the admin, but fully scriptable.


Standard WP-CLI conventions

Every command follows WP-CLI’s conventions:

  • --help on any command shows full usage and flag documentation
  • --format=json|csv|yaml|table for machine-readable output
  • --dry-run on every write command to preview without making changes
  • Exit codes that are safe to check in shell scripts (0 for success, non-zero for failure)
  • Colorized output when running in a TTY, plain when piped

Use cases

  • Agency onboardinga shell script that configures a new client site with the right languages, URL format, and starter content in one command
  • Nightly content synca cron job that exports XLIFF for the current week’s new posts and emails it to a translation vendor
  • CI test coveragea pipeline step that runs wp langforge status --fail-if-incomplete to block deploys if new strings are untranslated
  • Data migrationtm-populate after importing content from another CMS
  • Disaster recoveryscripted re-import of translations from a backup file

Ready to script your multilingual workflow?

Get Lang Forge — from $54/year →

WP-CLI commands are included in every paid plan and in the free version on WordPress.org.

Forge AI Assistant Online

Hi! I'm the Lang Forge AI assistant. Ask me anything about the plugin — setup, features, troubleshooting, or development.

Just now
Powered by Forge AI · Browse docs