Tools to automate the Translations
setting in ACF fields when working with Polylang Pro + ACF Pro.
No more manually setting "Copy Once", "Ignore" or "Synchronize" for each field. Automate this process and save your time.
Feature | Description |
---|---|
Bulk update | Update ACF field translation modes via WP-CLI |
Nested support | Supports groups, repeaters, flexible content |
Two methods | Use either as a one-time script or as a WP-CLI plugin |
Quick script | One-time script for fast changes without CLI command |
File | Location |
---|---|
plugin-cli.php |
Place in wp-content/mu-plugins (or plugins ) for WP-CLI usage |
script-cli.php |
Anywhere (optional), used with wp eval-file for one-time updates |
git clone https://github.com/your-repo/cli-polylang-acf.git
plugin-cli.php
registers a custom WP-CLI command:
wp acf-polylang set --mode=copy_once --type=image
Option | Description |
---|---|
--mode |
ignore / copy_once / translate / synchronize / translate_once |
--type |
image / text / textarea / wysiwyg / group / repeater / * (all types) |
# Set all image fields to "Copy Once"
wp acf-polylang set --mode=copy_once --type=image
# Set all text and textarea fields to "Ignore"
wp acf-polylang set --mode=ignore --type=text,textarea
# Set everything to "Synchronize"
wp acf-polylang set --mode=synchronize --type=*
For quick changes without installing the CLI command:
wp eval-file path/to/script-cli.php
Before running, edit script-cli.php
to configure:
$mode = 'copy_once'; // Mode: ignore, copy_once, translate, synchronize
$targetType = 'image'; // Field type (or "*" for all)
When executed, all matching ACF fields will be updated recursively.
Use case | Recommended method |
---|---|
One-time bulk update | One-time Script (simple and quick) |
Regular / repeatable updates or automation | WP-CLI Command (recommended) |
CI/CD or deployment tasks | WP-CLI Command |
Developers unfamiliar with CLI | One-time Script |
Both methods produce the same result — choose based on your workflow and frequency of use.
Tip | Info |
---|---|
Backup | Always backup your database before bulk updating fields |
Sub fields | Supported: group, repeater, flexible content |
Auto updates | Automatically updates ACF field objects in the database |
ACF JSON | Run wp acf sync or resave field groups after updating |
MIT — free to use, modify, and share.
Made for developers who don't want to click hundreds of fields manually. Enjoy automation and focus on what matters.
- Initial stable release.
- WP-CLI command support to bulk update ACF translation modes.
- One-time PHP script for fast non-CLI usage.
- Support for nested fields: Group, Repeater, Flexible Content.
- MIT license.
- Make sure to backup the database before using the bulk update scripts.
- Compatible with ACF JSON sync workflows.