Gutenberg blocks
WP Clinic Translator extracts text from core Gutenberg blocks and lets you translate it from the central Translations hub.
Classic editor
Pages saved as plain HTML (no block comments) are also scanned. Paragraphs, headings, and list items are registered with keys like block:{post_id}:classic.0:innerHTML.
Supported blocks (v0.2)
| Block | What is translated |
|---|---|
| Paragraph | Text in the block |
| Heading | Heading text |
| Button | Button label (text attribute) |
| Quote / Pullquote | Quote text |
| List item | Item text |
| Cover, Media & Text | Title and description attributes |
Nested blocks (groups, columns) are scanned recursively.
Workflow for editors
- Create or update your page in the default language (e.g. Dutch)
- Save the page — block strings are registered automatically
- Open WP Clinic Translator → Translations → Gutenberg
- Choose the target language (e.g. English)
- Fill in translations and click Save translations
- Open the page under
/en/...to preview
Bulk import
Click Scan Gutenberg content on the Translations page to register block text from your 50 most recently updated posts and pages.
Tip
If a block does not appear, view the page once on the frontend in the default language — that also registers block strings.
What Gutenberg does not cover yet
- Full duplicate posts per language (linked translation pages) — planned
- Third-party block plugins — use developer hooks below
- ACF fields — out of scope for now
For developers
Register extra blocks that store copy in innerHTML:
php
add_filter( 'wpc_translator_gutenberg_inner_html_blocks', function ( array $blocks ): array {
$blocks[] = 'my-plugin/custom-block';
return $blocks;
} );Add custom extracted segments:
php
add_filter( 'wpc_translator_gutenberg_segments', function ( array $segments, int $post_id ): array {
$segments[] = [
'item_key' => 'block:' . $post_id . ':custom:hero',
'field' => 'innerHTML',
'value' => 'Hero headline',
'block_name' => 'my-plugin/hero',
'block_path' => '0',
'context' => 'gutenberg:' . $post_id . ':my-plugin/hero',
];
return $segments;
}, 10, 2 );Registry keys use the format block:{post_id}:{block_path}:{field}.