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: America/Lima (GMT-05:00)

This topic contains 7 replies, has 0 voices.

Last updated by Andreas W. 4 hours, 6 minutes ago.

Assisted by: Andreas W..

Author Posts
January 10, 2025 at 1:32 pm #16582186

Kresimir

Background of the issue:
I am trying to publish a post that has images, and when I add new images, the fields for ALT tags in the translation editor double. Here is a screenshot of the issue: hidden link. The issue can be seen on this page: hidden link.

Symptoms:
ALT tags have double fields when translating them.

Questions:
Why do the ALT tag fields double in the translation editor when I add new images?

January 10, 2025 at 8:48 pm #16583307

Andreas W.
Supporter

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

Timezone: America/Lima (GMT-05:00)

Hello,

Do I understand correctly that the post in your example only has one image or does it have three or more images?

Best regards
Andreas

January 13, 2025 at 9:37 am #16587333

Kresimir

Hey Andreas

Here is a more detailed explanation step by step:
1. I create a new post in English that has one image and the image as alt text entered.
2. I translate the new post in to another language (including the image alt text).
3. I update the original post that's in English and add a new image in the post.
4. When I go to update the translation the WPML editor has the fields where I should enter the translation of the alt text of the new image doubled (it has two fields for the alt text of the new image).

You can see in my screenshot (hidden link) where "Photo 2" and "Photo 3" show up each 2 times. These are the original alt tags for two new images but they are shown twice each in the translation editor.

Let me know if you have any questions. I can give you admin access to the site if that helps.

January 14, 2025 at 7:12 pm #16594669

Andreas W.
Supporter

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

Timezone: America/Lima (GMT-05:00)

I was able to replicate the issue in the following way:

1) Upload an image to the media library and give it an Alt value
2) Create a post, add the image
3) Now, on the block add a new Alt value

- You will end up with two Alt values on the translation editor, one coming from the media library and one coming from the block

Could it be the case, that your image already had an "Alt" value on the media library and then you addded an image block in which you added a new "Alt" value directly inside the block?

Test Site:
hidden link

January 16, 2025 at 11:03 am #16601537

Kresimir

Hey Andreas. Thank you for your reply. Glad you can recreate the issue.

As for your question on if the additional alt tag comes from the block, isn't that better sent to your development team :)... I don't know what caused it but it's definitely a strange and confusing behavior. It's also causing issues with our clients site since the translation agency they are using doesn't know which alt tag comes from the file and which from the block and they charge by translation so their translating content that will never be visible.

Hope you can help.

January 16, 2025 at 6:49 pm #16603589

Andreas W.
Supporter

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

Timezone: America/Lima (GMT-05:00)

The behavior in this case is expected and this is not caused by WPML.

If you add an Alt tag to a Block then this attribute is saved to the content of this post and not saved inside the media library.

You can go to WPML > Settings > Media Translation and disable the last option inside this section. This way you will not translate the media library values together with each post.

January 17, 2025 at 2:39 pm #16606735

Kresimir

Yes but when I add an image to the media library and add an alt tag within the media library the translation editor doesn't take that into account.

For example I've uploaded an image on the test website and added an alt tag there (hidden link) and then I created a new post on the test site that contains that image (hidden link). WordPress uses the alt tag that I already added inside Gutenberg. It's not like I see two of them. But when I go and translate the post I get two of those alt tags (hidden link).

If I'm understanding you correctly this is actually the intended behavior of WPML?

As for your suggestion to remove the setting this doesn't work for us because some images have their tags set in the media library and some during post creation so we can't disable that option.

January 17, 2025 at 4:22 pm #16607474

Andreas W.
Supporter

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

Timezone: America/Lima (GMT-05:00)

Sorry for the misunderstanding.

I meant to say that this is not caused by WPML.

There is simply coming one Alt text from the media library and one from each block.

If you add an "Alt" text to a Block, then this will be saved together with the block on the post or page.
This is different from using the media library.

If you use "Alt" on a block, there is not connection to the media library and this is why you got two entries on the translation editor.

Also, if you use various blocks, then there should be one segment for each block.