TranslatePress
TranslatePress is a WordPress translation plugin that translates pages by capturing the full HTML output and running string substitutions on it. WP Media Cloud and TranslatePress work together without conflict and without any configuration. Because TranslatePress operates on the rendered HTML output, it always sees CDN URLs that WP Media Cloud has already produced.
How they work together#
TranslatePress captures the page HTML via an output buffer after WordPress has finished rendering the page. By this point, WP Media Cloud has already filtered all attachment URL functions and all media URLs in the page are cloud storage or CDN URLs. TranslatePress’s translation substitutions run on the already-rewritten HTML. There is no conflict between the two plugins and no ordering issue to configure.
TranslatePress does not create separate attachment posts per language. All language versions of a page share the same WordPress media library, so media offloaded by WP Media Cloud is automatically available at the CDN URL across all language versions.
Srcset handling#
When TranslatePress detects a translated image src and the image tag has a srcset attribute, it regenerates the srcset by calling WordPress’s srcset functions. WP Media Cloud filters those functions at priority 99, so the regenerated srcset values contain CDN URLs rather than local upload URLs.
Manually translated image URLs#
There is one edge case to be aware of. If you have used the TranslatePress visual editor to manually translate individual image src values — entering a different image URL for a specific language — TranslatePress stores the original local URL as the lookup key in its translation table. After WP Media Cloud offloads media and CDN-rewrites URLs, the rendered src value is a CDN URL rather than the local URL that TranslatePress has stored as the key. The substitution does not fire and the manually translated image URL is not applied for that language.
This only affects image URLs that were manually translated in the TranslatePress visual editor. Ordinary page content where images are output through WordPress attachment functions is not affected. To resolve it, open the affected pages in the TranslatePress visual editor and re-save the translations after WP Media Cloud is configured. This updates the lookup keys to the CDN URLs.
Configuration#
No configuration is required. WP Media Cloud detects TranslatePress automatically via the TRP_PLUGIN_VERSION constant and reports its status on the Integrations tab. TranslatePress works with WP Media Cloud on all plans including the free version.
Troubleshooting#
Images on translated pages are showing local URLs
Confirm URL rewriting is enabled in WP Media Cloud > Settings and that the images have been offloaded. If images are offloaded but still showing local URLs, a page cache may be serving HTML that was cached before WP Media Cloud was configured. Clear the page cache and reload.
Manually translated image URL is not applying on a translated page
The TranslatePress lookup key for that translation is the original local URL, which no longer matches the CDN URL that WP Media Cloud produces. Open the page in the TranslatePress visual editor, find the translated image, and re-save the translation. This updates the lookup key to the current CDN URL.