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.

This topic contains 1 reply, has 0 voices.

Last updated by Alejandro 6 days, 1 hour ago.

Author Posts
December 2, 2024 at 9:46 pm #16468607

katarzynaT-5

Background of the issue:
I am encountering an issue with image translations in WPML. I use Rank Math to handle image translations (ALT text, titles, etc.), so WPML translating media is redundant for my workflow. However, I cannot disable all media (attachment) translations because when I add a new product and translate it, the image does not display if media translations are disabled. When I set the media to Translatable, WPML translates fields that Rank Math already manages, which creates unnecessary duplication. I need the appropriate line of code to prevent WPML from translating media (attachments) completely and ensure that the media duplication option works as intended so images are properly associated with translated products.

Symptoms:
When media translations are disabled, images do not display for translated products. Enabling media translations causes duplication of fields managed by Rank Math.

Questions:
How can I prevent WPML from translating media (attachments) completely?
How can I ensure that the media duplication option works as intended so images are properly associated with translated products?

December 5, 2024 at 10:13 am #16480819

Alejandro
Supporter

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

Timezone: Europe/Rome (GMT+01:00)

Hello,

I'm going to try to help here while a supporter takes the case.

What you're mentioning is not media translation per sè but media duplication since the actual images are not changing (only their metadata is).

If you noticed, the media Custom Post Type is locked by default as "translatable" and that's not by mistake. We locked it because pages and content are entries in the DB and images are too, while the actual media files are never duplicated, the entries in the database are, exactly because of the metadata, they need to be different on each language (or well, they should, to improve your SEO and for accessibility reasons).

You do not need the media translation plugin, in this case, so you can disable it and it should not affect anything on your end at all.

You mention:

WPML translates fields that Rank Math already manages, which creates unnecessary duplication

You mentioned metadata, but I'm not sure how is it that you see it duplicated, do you mean it appears twice in the translation editor? because if that's the case, we can try to create a feature request for this, but it's very likely it's duplicated because rankmath only creates a NEW entry on the database with the same content as the image so it results in 2 entries in the database hence the duplication you mean and that is likely to be difficult to fix since if you were not using WPML, you'd still have the ability to edit and changed the images metadata AND rankmath metadata for the images (the duplication would still exist but you wouldn't "see" it).

Regards