Skip to content Skip to sidebar

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.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Europe/Kyiv (GMT+03:00)

This topic contains 10 replies, has 0 voices.

Last updated by Andrey 1 day, 18 hours ago.

Assisted by: Andrey.

Author Posts
July 14, 2025 at 12:48 pm #17233924

edina.gora

Background of the issue:
I am trying to resolve an issue with media file URLs after changing the domain for the Spanish version of my website. Originally, the Spanish content was served from a subdomain: es.relatedpresence.com. Now, I’ve switched to a dedicated domain: presenciarelacionada.com. In WPML → Languages, I have updated the domain for the Spanish language, and the language switcher and all regular pages reflect the correct domain. However, media files still reference the old subdomain. I have tried updating WPML language domain settings, clearing all site caches, using the 'Start' button under WPML → Media Translation, and running Better Search Replace across all relevant database tables. I want to use a single, shared media library across all languages. Link to a page where the issue can be seen: hidden link

Symptoms:
Media files uploaded under the Spanish language still reference the old subdomain in their URLs, even after updating domain settings and clearing caches. Newly uploaded images also point to the old domain.

Questions:
Where is WPML storing the outdated es.relatedpresence.com domain references for media items?
How can I safely resync media URLs to reflect the current domain configuration?
How can I ensure that new uploads under the Spanish language respect the updated presenciarelacionada.com domain?

July 14, 2025 at 2:09 pm #17234353

Andrey
WPML Supporter since 06/2013

Languages: English (English ) Russian (Русский )

Timezone: Europe/Kyiv (GMT+03:00)

Thank you for contacting WPML support.

Have you tried the following?

- Go to WPML > Settings
- Scroll down until the section “Translate Link Target”
- Click the “Apply” Button
- Wait until the process finishes.

If this is still the issue, consider testing the following workaround:
https://wpml.org/forums/topic/image-urls-are-wrong/#post-13652975

More details:
https://wpml.org/errata/wrong-url-on-translated-media-files-when-using-a-different-domain-per-language/

Before making any changes, please ensure that you back up your database first.

July 14, 2025 at 3:27 pm #17234777

edina.gora

Dear Andrey,
Thank you for your reply.
I clicked the apply button at Translate Link Target.
After it finished the process, I emptied the cache in file manager.

Unfortunately still have the same problem.
And I see the es.relatedpresence.com folder in the fresh cache - instead of presenciarelacionada.com folder.

And also strange, that the menu in the English and Hungarian Home page doesn't show the Spanish flag, although the page translated and ready. Other pages shows the flag properly.

Thank you for your support.

July 14, 2025 at 3:37 pm #17234813

Andrey
WPML Supporter since 06/2013

Languages: English (English ) Russian (Русский )

Timezone: Europe/Kyiv (GMT+03:00)

Thank you for your feedback.

Have you had a chance to test another solution from the links I shared?

July 14, 2025 at 8:05 pm #17235556

edina.gora

Yes, I put the code 1
do_action( 'wpml_switch_language', $language ); in the class-wpml-media-image-translate.php
After I used the 2nd method again by Translate Link Target process.
I emptied all the caches and I opened the website in incognito window.
Unfortunately there is no change.
If that can be helpful, I can give you an admin entrance for the website.

php.jpg
July 15, 2025 at 3:50 pm #17238901

Andrey
WPML Supporter since 06/2013

Languages: English (English ) Russian (Русский )

Timezone: Europe/Kyiv (GMT+03:00)

Thank you for your feedback.

Were the images originally uploaded through the es.relatedpresence.com domain, or were they initially uploaded from the English version of the site?

To clarify (if I correctly understood), if you upload a new image while using the Spanish version, does it still display the old domain in the URL?

I need to request temporary access (wp-admin and FTP) to your site—preferably to a test site where the problem has been replicated if possible—in order to be of better help. When you log in to leave your next reply, you will find the needed fields below the comment area. The information you will enter is private, meaning only you and I can see and access it.

July 16, 2025 at 8:01 pm #17243635

Andrey
WPML Supporter since 06/2013

Languages: English (English ) Russian (Русский )

Timezone: Europe/Kyiv (GMT+03:00)

Thank you for the details, Edina.

I’ll check this further and update you.

In the meantime, could you please clarify how the images are being set on the page (for example)? Upon a quick inspection, I noticed that the image URLs appear to be correct in the Media Library. This information will help me better understand where the issue might be. It feels like the image URLs are hardcoded.

July 17, 2025 at 9:31 am #17244703

edina.gora

Dear Andrey, thank you again for your help.

To clarify regarding the image setup:

We have not hardcoded image URLs across the site — all images were added via the standard Divi Builder interface using image modules or background settings.

However, on the Spanish homepage (/inicio), I did experiment briefly with manually inserting the image URL from the English version in an attempt to solve the broken image issue — but this did not resolve the problem, so I can revert it if you wish. I have not applied this method on any other page.

Interestingly, on mobile, the hero image on the Inicio page does appear correctly, while it does not show up on desktop — which makes me wonder if there’s some caching or layout discrepancy happening as well.

In addition, I’m now seeing a few more unexpected issues on the Spanish homepage:

The content showing appears to be the English version.
The menu item says “Home” instead of “Inicio”.
There is a number “3” displayed next to the menu item, only in the Spanish menu.

Caches have been cleared, but these issues persist.

Let me know if you need further details or screenshots — and thank you again for your continued support.

July 18, 2025 at 2:31 pm #17250777

Andrey
WPML Supporter since 06/2013

Languages: English (English ) Russian (Русский )

Timezone: Europe/Kyiv (GMT+03:00)

Thank you for your feedback.

We have not hardcoded image URLs across the site — all images were added via the standard Divi Builder interface using image modules or background settings.

Could you please share a screenshot to illustrate this? Or were you able to fix the issue already? I’m asking because I now see that the images are appearing correctly on the site.

The content showing appears to be the English version.
The menu item says “Home” instead of “Inicio”.
There is a number “3” displayed next to the menu item, only in the Spanish menu.

The reason the menu says “Home” is likely because the Spanish homepage still has the title “Home” instead of “Inicio.” To correct this:
1. Open the original (English) homepage.
2. Make a small change (e.g., change “Home” to “Home.”), save the page, then revert the change and save again.
3. Open the WPML translation editor and update the Spanish translation by changing the title to “Inicio” and completing the translation.

July 18, 2025 at 5:09 pm #17251561
edina.gora

Dear Andrey,

Thank you again for your kind support.

Your suggestions helped a lot:
I retranslated the homepage
Cleared all caches

And now everything seems to display correctly — including all images across pages and languages.

Also, the es.relatedpresence.com references have disappeared from the cache folders and media URLs, which is great.

There is only one issue remaining:

The Spanish version of the site logo (SVG) does not display correctly.
I tried to assign the translated logo using Media Translation, but:
It shows a broken image icon in the interface
And it loads the English logo instead on the frontend

Interestingly, the Hungarian version of the logo works fine.
This issue affects only the Spanish SVG.

I’ve attached a screenshot below that shows what happens on the Media Translation screen.

📎 See attachment: logo missing.jpg

The logo's permalink: hidden link
File URL: hidden link

Could you please advise how to fix this or suggest a better way to assign the SVG logo for each language?

Thanks again for your help and time — I really appreciate your detailed responses!

Warm regards,
Edina Góra

New threads created by Andrey and linked to this one are listed below:

https://wpml.org/forums/topic/split-the-spanish-version-of-the-site-logo-svg-does-not-display-correctly/

logo missing.jpg
July 21, 2025 at 4:20 pm #17256822

Andrey
WPML Supporter since 06/2013

Languages: English (English ) Russian (Русский )

Timezone: Europe/Kyiv (GMT+03:00)

Hello Edina,

I hope you had a great weekend. I’m glad to hear that the original issue has been resolved.

Since that matter is now resolved, I’ve created a new support ticket to assist you with the other issue. I’ll continue helping you here:
https://wpml.org/forums/topic/split-the-spanish-version-of-the-site-logo-svg-does-not-display-correctly/