WPML
WPML is a WordPress multilingual plugin that manages translations of posts, pages, and custom post types. WP Media Cloud has a dedicated WPML integration that handles two distinct scenarios: when WPML reuses the same media file across language versions, and when an editor uploads a language-specific replacement image.
How they work together#
WPML hooks wp_get_attachment_url at priority 10 to handle its own URL transformations. WP Media Cloud hooks the same filter at priority 99, which means WP Media Cloud always runs after WPML and correctly replaces any WPML-modified URL with the cloud storage or CDN URL. No conflicts occur from this filter priority ordering.
Beyond URL rewriting, WP Media Cloud handles two WPML-specific scenarios:
Scenario 1: Same file across languages
When WPML creates a translated version of an attachment that points to the same physical file as the original, it creates a new WordPress attachment post ID for the translated version. Without any integration, WP Media Cloud’s tracking database would have a record for the original attachment ID but not the translated ID. When WordPress generated the URL for the translated attachment ID, it would return the local upload URL instead of the cloud URL.
WP Media Cloud handles this by hooking WPML’s wpml_after_copy_attached_file_postmeta action. When WPML creates a translated attachment, WP Media Cloud copies its tracking record from the original attachment ID to the new translated ID, pointing to the same cloud file. The translated attachment immediately resolves to the cloud URL without any re-upload.
Scenario 2: Language-specific file
When an editor uploads a different image for a specific language — replacing the default with a translated or locally relevant version — WPML uploads the new file to the server and fires wpml_added_media_file_translation. WP Media Cloud hooks this action and offloads the language-specific file to cloud storage, the same as any other new upload.
WPML Media Translation#
The dedicated media scenarios above require the WPML Media Translation plugin to be installed alongside WPML core. WP Media Cloud detects both WPML core and WPML Media Translation separately and reports both on the Integrations tab. If only WPML core is active without WPML Media Translation, the URL priority ordering still works correctly but the attachment ID copy and translated file offload hooks are not triggered.
Configuration#
No configuration is required. WP Media Cloud detects WPML automatically and initialises the integration hooks. Standard WPML workflow — creating translations, assigning media to language versions — works as normal. Cloud storage URLs are resolved for all language versions of a page automatically.
Troubleshooting#
Translated page is showing local URLs for media
The most likely cause is that the translated attachment ID does not have a WP Media Cloud tracking record. This can happen if the attachment was duplicated before WP Media Cloud was installed, or if the wpml_after_copy_attached_file_postmeta action did not fire. Re-save the original post in WPML to trigger a fresh copy, or run the bulk migration tool to ensure all attachment IDs are tracked.
Language-specific uploaded file is not being offloaded
Confirm WPML Media Translation is installed and active. The wpml_added_media_file_translation action that WP Media Cloud hooks is only fired when WPML Media Translation is present. Without it, language-specific uploads are treated as regular uploads and go through the standard automatic offloading path if automatic offloading is enabled.
WPML and WP Media Cloud both modifying URLs causing conflicts
WP Media Cloud runs at priority 99 on wp_get_attachment_url, after WPML’s priority 10. WP Media Cloud replaces whatever URL WPML produced with the cloud URL. If you see doubled rewrites or malformed URLs, check whether a third plugin is also filtering attachment URLs at a priority between 10 and 99.