All commands are under the wp langforge namespace. These commands are essential for managing translations in bulk, automating deployment workflows, and scripting translation processes.
wp langforge status
Show translation status overview with post counts per language and completion percentages.
$ wp langforge status
+------+---------+-------+---------+
| Code | Language | Posts | Default |
+------+---------+-------+---------+
| ru | Русский | 45 | Yes |
| en | English | 38 | |
| de | Deutsch | 12 | |
+------+---------+-------+---------+| Flag | Description | Default |
|---|---|---|
--format | Output format: table, json, csv | table |
wp langforge languages
List all active languages with their configuration details.
$ wp langforge languages
+------+---------+---------+--------+---------+
| Code | Name | Native | Locale | Default |
+------+---------+---------+--------+---------+
| ru | Russian | Русский | ru_RU | * |
| en | English | English | en_US | |
+------+---------+---------+--------+---------+wp langforge translate
Create a translation copy of a post in the specified language.
$ wp langforge translate 42 en
Success: Created translation #99 (en) for post #42.| Argument | Description |
|---|---|
| Source post ID |
| Target language code |
| Flag | Description | Default |
|---|---|---|
--status | Post status for new translation | draft |
# Batch translate: create English versions for all Russian posts
$ wp post list --meta_key=_lf_language --meta_value=ru --format=ids |
xargs -I{} wp langforge translate {} enwp langforge set-language
Set or change the language of an existing post.
$ wp langforge set-language 42 ru
Success: Set language 'ru' for post #42.
# Bulk set language for all posts without a language
$ wp post list --meta_key=_lf_language --meta_compare='NOT EXISTS' --format=ids |
xargs -I{} wp langforge set-language {} ruwp langforge link
Link two existing posts as translations of each other.
$ wp langforge link 42 99
Success: Linked posts #42 and #99 as translations.wp langforge unlink
Remove a translation link. This does not delete the target post.
$ wp langforge unlink 42 en
Success: Unlinked en translation from post #42.wp langforge tm-populate
Populate Translation Memory from all existing translations (PRO).
$ wp langforge tm-populate
Populating Translation Memory from existing translations...
Processing 150 translation groups...
Success: Added 342 segments to Translation Memory.wp langforge export
Export translations to XLIFF or CSV format.
# Export to XLIFF (default)
$ wp langforge export --lang=en --format=xliff --output=export-en.xliff
Success: Exported 42 posts to export-en.xliff
# Export to CSV
$ wp langforge export --lang=de --format=csv --output=export-de.csv
Success: Exported 42 posts to export-de.csv| Flag | Description | Default |
|---|---|---|
--lang | Target language code (required) | — |
--format | xliff or csv | xliff |
--output | Output file path | auto |
--post_type | Filter by post type | all |
--status | Filter by post status | publish |
wp langforge import
Import translations from an XLIFF or CSV file.
$ wp langforge import translations.xliff
Success: Imported 156 translations.wp langforge flush
Flush WordPress rewrite rules.
$ wp langforge flush
Success: Rewrite rules flushed.Scripting Examples
# Complete deployment script: set up translations on a new site
#!/bin/bash
# 1. Check status
wp langforge status
# 2. Set language for all unassigned content
wp post list --meta_key=_lf_language --meta_compare='NOT EXISTS' --format=ids |
xargs -I{} wp langforge set-language {} ru
# 3. Create English translations for all Russian posts
wp post list --meta_key=_lf_language --meta_value=ru --post_type=post --format=ids |
xargs -I{} wp langforge translate {} en
# 4. Flush rewrite rules
wp langforge flush
# 5. Verify
wp langforge status—