Skip to content Skip to sidebar

This thread is resolved. Here is a description of the problem and solution.

Problem:
You are experiencing an issue where your media files, stored on DigitalOcean Spaces, are incorrectly loading from your local domain on translated pages (e.g., the French version), despite previously functioning correctly.
Solution:
1. Ensure you have a full backup of your website, including the database.
2. Use a search and replace plugin to update incorrect media URLs in your database. This will correct instances where the translated domain is used instead of your DigitalOcean Spaces URL.
3. Re-save your permalinks and clear any existing cache to see if the issue resolves.
4. If the problem persists, consider using the code provided to rewrite URLs conditionally based on the language. This involves adding filters to modify attachment URLs, image src arrays, responsive images, and hardcoded images in post content.

If these steps do not resolve your issue or if the solution becomes outdated, we recommend opening a new support ticket. Additionally, check related known issues at https://wpml.org/known-issues/, verify the version of the permanent fix, and confirm that you have installed the latest versions of themes and plugins. For further assistance, please visit our support forum at WPML Support Forum.

This is the technical support forum for WPML - the multilingual WordPress plugin.

Everyone can read, but only WPML clients can post here. WPML team is replying on the forum 6 days per week, 22 hours per day.

Tagged: 

This topic contains 2 replies, has 0 voices.

Last updated by Carlos Rojas 2 months, 3 weeks ago.

Assisted by: Carlos Rojas.

Author Posts
January 19, 2026 at 9:57 am #17741626

Sumit Singh

I am facing an issue with media translation. My media files are stored on DigitalOcean Spaces and are saved under this path: hidden link
However, on translated pages (for example, the French version), the site is trying to load media from the following URL instead: hidden link

Previously, this setup was working correctly. I have applied a code fix as a temporary solution; however, I want to understand why this issue is occurring and find a proper solution that does not require a custom code fix.

January 19, 2026 at 10:48 am #17741934

Carlos Rojas
WPML Supporter since 03/2017

Languages: English (English ) Spanish (Español )

Timezone: Europe/Madrid (GMT+02:00)

Hi there,
This is the forum ticket where we will continue working on this issue.

I have set your next message private so you can share the access credentials to the site in a secure way.

Looking forward to your message.
Regards,
Carlos

January 22, 2026 at 11:28 am #17753502

Carlos Rojas
WPML Supporter since 03/2017

Languages: English (English ) Spanish (Español )

Timezone: Europe/Madrid (GMT+02:00)

Thank you for sharing the credentials requested.

I can see you found a workaround already. If you still need our assistance, I'd recommend creating a site backup and then going to WPML -> Settings -> Media Translation -> Activate 'Automatically detect best options for translating image texts (alt, caption, title)' and check if the issue has disappeared.