[Resolved] ALT tags hav double fields when translating them
This thread is resolved. Here is a description of the problem and solution.
Problem: If you're experiencing an issue where ALT tag fields double in the translation editor when adding new images to a post, it might be due to adding an ALT value both in the media library and directly in the image block within the post editor. Solution: We have identified that this behavior is expected and not caused by WPML. When you add an ALT tag directly to an image block, this attribute is saved with the post content rather than in the media library. To avoid translating media library values along with each post, you can navigate to WPML > Settings > Media Translation and disable the last option in this section. This adjustment ensures that only the ALT text added to the block is used, preventing duplication in the translation editor.
If this solution does not apply to your situation, or if it seems outdated, we highly recommend checking related known issues at https://wpml.org/known-issues/, verifying the version of the permanent fix, and confirming that you have installed the latest versions of themes and plugins. Should you need further assistance, please do not hesitate to open a new support ticket 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.
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?
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.
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?
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.
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.
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.
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.