Skip Navigation

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 – 18:00 9:00 – 18:00 9:00 – 18:00 9:00 – 18:00 9:00 – 18:00 - -
- - - - - - -

Supporter timezone: Asia/Yerevan (GMT+04:00)

Tagged: 

This topic contains 2 replies, has 0 voices.

Last updated by Christopher Amirian 4 days, 9 hours ago.

Assisted by: Christopher Amirian.

Author Posts
March 11, 2025 at 2:02 pm #16802121

pawelF-5

Background of the issue:
I am trying to translate a blog post using the classic editor view and the normal flow (ATE). In the original version, images have a 'link to media file.'

Symptoms:
After translation, the image links change to 'custom link,' causing only the thumbnail to open in the lightbox instead of the full-size image. Manually changing it back to 'link to media file' resolves the issue.

Questions:
Why do image links change from 'link to media file' to 'custom link' after translation?
How can I ensure that image links remain as 'link to media file' during translation?

March 11, 2025 at 4:07 pm #16802817

Christopher Amirian
WPML Supporter since 07/2020

Languages: English (English )

Timezone: Asia/Yerevan (GMT+04:00)

Hi,

Welcome to WPML support.

The issue is reported to the second tier support. I will get back to you as soon as I have news.

Thank you.

March 24, 2025 at 8:25 am #16850133

pawelF-5

Do you have any information for me?

March 25, 2025 at 1:29 pm #16857917

Andrey
WPML Supporter since 06/2013

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

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

Christopher is currently unavailable. I have confirmed that the issue has been reported, but there are no updates at this time. We will update you here as soon as more information is available.

April 4, 2025 at 7:18 pm #16898850

pawelF-5

Hi,

any news for me?

April 6, 2025 at 9:22 am #16900994

Christopher Amirian
WPML Supporter since 07/2020

Languages: English (English )

Timezone: Asia/Yerevan (GMT+04:00)

Hi,

The issue has already been reported to the second-tier support.

To make sure we are on the same page, the difference between the media URL and the custom link is not visible on default use-cases for WordPress.

For your scenario it shows the difference by the image size. This is considered an edge case; if there is a workaround, we will share it with you.

If not, this will go to the development team, and it will take time due to priorities.

I will surely communicate here if there is a workaround.

Thank you for your understanding.

April 18, 2025 at 3:28 pm #16947706

Christopher Amirian
WPML Supporter since 07/2020

Languages: English (English )

Timezone: Asia/Yerevan (GMT+04:00)

Hi,

Would you please update WPML to version 4.7.3 and also update WPML String translation? Then please cehck by adding a new media and see if the issue is still there or not.

Thank you.

April 21, 2025 at 6:39 am #16950739

pawelF-5

Great news. Give me a moment, I'll test it and let you know.

April 21, 2025 at 2:35 pm #16952034

Christopher Amirian
WPML Supporter since 07/2020

Languages: English (English )

Timezone: Asia/Yerevan (GMT+04:00)

Thank you. I would appreciate it as we see mixed results and need your confirmation first.

Thanks.

April 24, 2025 at 10:32 am #16963842

pawelF-5

Unfortunately, that didn't help. I have the latest versions of the plugins and the error is still the same.

April 27, 2025 at 3:01 pm #16972439

Christopher Amirian
WPML Supporter since 07/2020

Languages: English (English )

Timezone: Asia/Yerevan (GMT+04:00)

Thank you. I will inform the second tier support.

April 29, 2025 at 2:50 pm #16979869

Christopher Amirian
WPML Supporter since 07/2020

Languages: English (English )

Timezone: Asia/Yerevan (GMT+04:00)

Hello,

Would you please test with the method below?

Use an image without any space in the name. So something like normal.png. Avoid using something like Screenshot 2025-04-09 at 7.07.50 PM.png

That should fix the issue.

Thanks.

May 1, 2025 at 1:00 pm #16986580

Christopher Amirian
WPML Supporter since 07/2020

Languages: English (English )

Timezone: Asia/Yerevan (GMT+04:00)

Hi again,

We have found that the problem might occur when there are some characters used in the image names that are like spaces but not actual space. For example the Mac devices create images when using the screenshot tool with that format.

WordPress do not replace such characters to hyphens and that was the problem cause.

If you want to avoid such scenarios you can use the code below which you can add to your functions.php file of your theme:

/**
 * Normalise ALL Unicode space-separator characters to a dash.
 *
 */
add_filter( 'sanitize_file_name', 'wpmlsupp_normalise_unicode_spaces', 5, 2 );
function wpmlsupp_normalise_unicode_spaces( $sanitised, $raw_filename ) {

    // Collapse every Unicode *space separator* (general-category Zs) to a single dash
    // Examples caught here: U+00A0 (NO-BREAK SPACE), U+202F (NARROW NBSP), U+2009 (THIN SPACE), etc.
    $raw_filename = preg_replace( '/\p{Zs}+/u', '-', $raw_filename );

    return $raw_filename;
}

The code above will not fix the issue for the current images but for future uploads. But the best way is to avoid using any special characters in your images.

Please get back to us with the result.

May 6, 2025 at 7:45 am #16999586

pawelF-5

But there are no breaks or spaces in the file names. The file name structure is always the same, containing only lowercase letters, numbers, and the characters “-” and “_”.

May 6, 2025 at 3:16 pm #17002543

Christopher Amirian
WPML Supporter since 07/2020

Languages: English (English )

Timezone: Asia/Yerevan (GMT+04:00)

Hi,

I tested that on the installation below and it worked ok if I used a normal image name:

hidden link

Would you please add a test page there and use one of your images to see if the issue can be seen?

Thanks.