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 5:00 – 13:00 5:00 – 13:00 5:00 – 13:00 5: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: America/Argentina/Buenos_Aires (GMT-03:00)

Tagged: 

This topic contains 14 replies, has 0 voices.

Last updated by Otto 1 day, 6 hours ago.

Assisted by: Otto.

Author Posts
September 22, 2025 at 11:12 am #17421346

Natalie Wood

Background of the issue:
I updated the WPML plugins to the latest versions 7 days ago. After that, images are being randomly deleted from my server. It is hard to pin down the exact steps that cause this to happen but it is definitely after doing a translation of a page in the Advanced translation editor. It doesn't happen after every translation though. I put a backtrace in my functions.php file to track what was doing the deleting of the files and it is definitely WPML. This is the backtrace:
[22-Sep-2025 10:33:30 UTC] delete_attachment called for Post ID: 7392
[22-Sep-2025 10:33:30 UTC] Image file /wp-content/uploads/Wave-Connect-video-preview.webp
[22-Sep-2025 10:33:30 UTC] Backtrace:
[22-Sep-2025 10:33:30 UTC] File: wp-includes/class-wp-hook.php, Line: 326, Function: my_delete_attachment_caller_info
[22-Sep-2025 10:33:30 UTC] File: wp-includes/class-wp-hook.php, Line: 348, Function: WP_Hook->apply_filters
[22-Sep-2025 10:33:30 UTC] File: wp-includes/plugin.php, Line: 517, Function: WP_Hook->do_action
[22-Sep-2025 10:33:30 UTC] File: wp-includes/post.php, Line: 6655, Function: do_action
[22-Sep-2025 10:33:30 UTC] File: wp-includes/post.php, Line: 3725, Function: wp_delete_attachment
[22-Sep-2025 10:33:30 UTC] File: wp-content/plugins/sitepress-multilingual-cms/inc/post-translation/wpml-post-synchronization.class.php, Line: 204, Function: wp_delete_post
[22-Sep-2025 10:33:30 UTC] File: wp-content/plugins/sitepress-multilingual-cms/inc/post-translation/wpml-post-synchronization.class.php, Line: 128, Function: WPML_Post_Synchronization->delete_translations
[22-Sep-2025 10:33:30 UTC] File: wp-content/plugins/sitepress-multilingual-cms/inc/post-translation/wpml-post-translation.class.php, Line: 157, Function: WPML_Post_Synchronization->delete_post_actions
[22-Sep-2025 10:33:30 UTC] File: wp-includes/class-wp-hook.php, Line: 326, Function: WPML_Post_Translation->delete_post_actions
[22-Sep-2025 10:33:30 UTC] File: wp-includes/class-wp-hook.php, Line: 348, Function: WP_Hook->apply_filters
[22-Sep-2025 10:33:30 UTC] File: wp-includes/plugin.php, Line: 517, Function: WP_Hook->do_action
[22-Sep-2025 10:33:30 UTC] File: wp-content/plugins/sitepress-multilingual-cms/classes/media-translation/PostWithMediaFiles.php, Line: 221, Function: do_action
[22-Sep-2025 10:33:30 UTC] File: wp-content/plugins/sitepress-multilingual-cms/classes/media-translation/PostWithMediaFiles.php, Line: 160, Function: WPMLMediaTranslationPostWithMediaFiles->delete_duplicated_attachment
[22-Sep-2025 10:33:30 UTC] File: wp-content/plugins/sitepress-multilingual-cms/classes/media/duplication/class-wpml-media-attachments-duplication.php, Line: 673, Function: WPMLMediaTranslationPostWithMediaFiles->delete_duplicated_copied_media
[22-Sep-2025 10:33:30 UTC] File: wp-content/plugins/sitepress-multilingual-cms/classes/media/duplication/class-wpml-media-attachments-duplication.php, Line: 559, Function: WPML_Media_Attachments_Duplication->maybe_clear_duplicated_copied_media_in_posts_queue
[22-Sep-2025 10:33:30 UTC] File: wp-includes/class-wp-hook.php, Line: 324, Function: WPML_Media_Attachments_Duplication->maybe_duplicate_original_post_media
[22-Sep-2025 10:33:30 UTC] File: wp-includes/class-wp-hook.php, Line: 348, Function: WP_Hook->apply_filters
[22-Sep-2025 10:33:30 UTC] File: wp-includes/plugin.php, Line: 517, Function: WP_Hook->do_action
[22-Sep-2025 10:33:30 UTC] File: wp-admin/includes/class-wp-screen.php, Line: 424, Function: do_action
[22-Sep-2025 10:33:30 UTC] File: wp-admin/includes/screen.php, Line: 243, Function: WP_Screen->set_current_screen
[22-Sep-2025 10:33:30 UTC] File: wp-admin/admin.php, Line: 213, Function: set_current_screen
[22-Sep-2025 10:33:30 UTC] File: wp-admin/upload.php, Line: 10, Function: require_once.
This happened after a very minor translation update where I pasted text into two places that weren't anything to do with images. Link to a page where the issue can be seen: hidden link

Symptoms:
Images are being randomly deleted from the server after translating a page using the Advanced translation editor. The issue does not occur after every translation.

Questions:
Why are images being deleted after translation?
How can I prevent WPML from deleting images?

September 22, 2025 at 6:08 pm #17423150

Otto
WPML Supporter since 09/2015

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

Timezone: America/Argentina/Buenos_Aires (GMT-03:00)

Hello,

Your debug backtrace shows the delete call originates in WPML Media Translation’s duplication/cleanup flow, specifically through WPMLMediaTranslation\PostWithMediaFiles and WPML_Media_Attachments_Duplication when WPML thinks an attachment is a duplicated copy to be cleared.

Please try the following:
- Go to WPML → Support → Troubleshooting.
- Run (in this order): Set language information, Fix post type assignment for translations, Assign translation status to duplicated content. Clear caches and retest ATE.

If this does not help, although the backtrace points to WPML it's worth to try the following test. Many times what triggers the problem is a compatibility issue:
**IMPORTANT:** Please try this in a staging environment or at least with a backup of your site files and database before continuing.
Disable all plugins except WPML-related and temporarily change the theme to a default WordPress such as Twenty Twenty-five.
Is the issue resolved with these settings? If so, please reactivate one by one to see which conflicts.

Best Regards,
Otto

September 23, 2025 at 1:27 pm #17425673

Natalie Wood

Thanks
I did the steps as suggested in the Go to WPML → Support → Troubleshooting section

The error was not resolved by that

As I said the error doesn't happen after every translation.

It took 22 times trying the translation before the error happened again, so disabling plugins and testing and then enabling one by one is going to take a huge amount of time.

Unfortunately I can't see a pattern as to what triggers the error.

Note that prior to the update of the WPML plugins there had never been a problem, so it is some issue with the updates.

To narrow it down: at the time I did the WPML updates, I also updated Gravity Forms multilingual and Advanced custom fields. That was all.

Was there an update to the advanced translation editor as well?

Can you give me more information on the situation, whereby WPML decides it has to delete an image?

Note that the last two times only one image has been deleted but other times it was more than one image. But never all the images in the post.

I am testing on my dev site, but the live site has the same issue as I updated the WPML plugins there before I realised this was an issue. Is there any way I can roll-back to the previous versions of the WPML plugins, just so that I can have the live site functional?

Also will it make any difference if I uncheck the: "When deleting a post, delete translations as well" setting? Would that stop image delete?

Thanks for any help you can give as this is a very difficult issue to troubleshoot.

September 23, 2025 at 2:59 pm #17426145

Otto
WPML Supporter since 09/2015

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

Timezone: America/Argentina/Buenos_Aires (GMT-03:00)

Hello,

Yes, I understand how hard and frustrating these kinds of issues are 🙁

You said that it took 22 attempts before you could reproduce the problem. You mean that you saved 22 times the same translation, or you saved 22 different translations until you were able to see the problem?

What kind of images are deleted from the post? I mean, are those regular image attachments or added in a custom field or as a gallery?

In the last version, WPML changed how media is handled:
https://wpml.org/download/wpml-media/?section=changelog
https://wpml.org/changelog/2025/08/wpml-4-8-human-quality-ai-translations/#improved-media-translation

So, which type of media is being deleted can give us a clue.

Did you enable automatic detection in WPML > Settings > Media Translation?

About your questions:

- When does WPML decide to delete an image?
The cleanup runs from the Media module after media auto-handling queues a post for “copied” images. For each image that was duplicated into a translation, WPML checks if the translated attachment still looks redundant (same caption/description/alt as the source). If so, it deletes the translated attachment record.
This deletion is performed by a direct SQL path (not wp_delete_attachment) inside PostWithMediaFiles::delete_duplicated_copied_media → delete_duplicated_attachment. The intent is to remove only the attachment post/meta, not necessarily the physical file.

133:161:/Users/ofwald/Local Sites/for-cursor/app/public/wp-content/plugins/sitepress-multilingual-cms/classes/media-translation/PostWithMediaFiles.php
public function delete_duplicated_copied_media() {
  ...
  if (
    $texts['caption'] !== $translation_texts['caption'] ||
    $texts['description'] !== $translation_texts['description'] ||
    $texts['alt'] !== $translation_texts['alt']
  ) {
    continue;
  }
  $this->delete_duplicated_attachment( $translation->element_id );
}
190:231:/Users/ofwald/Local Sites/for-cursor/app/public/wp-content/plugins/sitepress-multilingual-cms/classes/media-translation/PostWithMediaFiles.php
private function delete_duplicated_attachment( $post_id ) {
  global $wpdb;
  ...
  // Deletes terms/meta, fires delete_post/deleted_post, then:
  $result = $wpdb->delete( $wpdb->posts, array( 'ID' => $post_id ) );
  ...
  return $post;
}

The above focuses on the attachment post/DB. In some environments, other processes can remove files once attachments disappear or if they share paths, but the core cleanup uses SQL (not wp_delete_attachment).

- Will unchecking “When deleting a post, delete translations as well” stop image deletes?
No. That setting affects cross-language post deletion, not the media-duplication cleanup. The media cleanup runs independently under the Media module’s logic.
- If you need an immediate mitigation, try turning off automatic media handling (WPML → Settings → Media Translation → “Automatic image and media detection”).

- Was there an Advanced Translation Editor (ATE) update too?
- ATE is SaaS and gets frequent updates, but the behavior change relevant here is in WPML 4.8’s core/media layer (“automatic image and media detection” and the subsequent duplicate cleanup). So the likely trigger is the WPML core/media update, not ATE itself.

Best Regards,
Otto

September 24, 2025 at 5:21 am #17427343

Natalie Wood

Thanks

I don't quite understand from your explanation how the image is being deleted. You seem to suggest that only the DB post is being deleted however it is clear from the backtrace that WPML is deleting the file - so where in the logic does this happen?

One thing that may be relevant is that I create posts in English then translate to Danish however Danish is the default language.

Yes I have checked the "Automatically detect best options for translating image texts" option, however I did turn it off at one point and the images were still being deleted.

The images are added to the post in an image block. My theme is GeneratePress and I use a GenerateBlocks image block for all images. The Post I'm working on has about 23 images.

It was 22 translations of the same post that I did. Each time I did a minor (or no) edit in the English then did the translation to match. I tried various types of edits and translations to see if I could see any pattern.

I have a feeling that there is an issue with ATE. I have noticed some inconsistencies when I open the translation. Sometimes suddenly there is a field that is not translated. During the above testing at one point the slug was suddenly untranslated, although that was not the time the media were deleted.
Sometimes the autotranslate seems to override the translation that is already there with its own translation.

I've attached what shows in ATE for the image that has been deleted the last two times it happened. You can see that the ALT text is different for the translation so it shouldn't think that it is a 'duplicate' at all, Except of course now I realise that that 'ALT' is in the post and the translation is in the post. We never actually do a translation in the media file itself - is that the issue?

I have activity logging on
I have attached the post revision information form the translation I did just before the last time the image got deleted.
I have tried the exact same edit now but the image didn't get deleted, so it really does seem to be random.

Finally please let me know how I can roll back to the previous versions of the WPML plugins

activity.png
deleted-image.png
September 24, 2025 at 5:00 pm #17429949

Otto
WPML Supporter since 09/2015

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

Timezone: America/Argentina/Buenos_Aires (GMT-03:00)

Hello,

Thanks for the detailed explanation.

About rolling back. It’s generally safe—but do it carefully and in lockstep.

- What “safe” rollback means
- Roll back WPML core (sitepress-multilingual-cms) and all WPML add‑ons together to versions that were compatible with 4.7.6 (String Translation, Media Translation, WooCommerce Multilingual, ACFML, etc.).
- Always back up database + uploads first and test on staging before touching production.

- Compatibility notes
- WPML 4.8.x added “automatic image/media detection” and some new options/meta. Rolling back to 4.7.6 will simply ignore those extra options; no schema downgrade is required.
- The Advanced Translation Editor (ATE) is SaaS and unaffected by plugin rollback (jobs/translations remain intact).

- Recommended rollback steps
- Staging: restore a backup or snapshot → downgrade WPML core and its add‑ons together via the Commercial tab (OTGS Installer) or zips from your WPML account → clear caches.
- WPML → Support → Troubleshooting: run “Clear the cache in WPML”, “Set language information”, and “Fix element_type collation” to refresh internal state.
- Verify media, translations, and ATE saves work normally; only then mirror the change on production.

- Will this help with the image deletions?
- Likely yes, if the issue started with 4.8.x media changes.

Back to this weird and random issue:

- What actually deletes the file
- The “duplicate cleanup” WPML runs after ATE saves is designed to delete only the translated attachment record (database row), not the physical file. It does this via a direct SQL delete, not WordPress’s wp_delete_attachment.
- However, if any code path ends up calling wp_delete_attachment on that attachment (Core or another plugin/theme reacting to attachment deletion), WordPress will remove the physical file and its sizes. Since your backtrace shows wp_delete_attachment, we need to pinpoint which hook calls it. That’s not the intended cleanup path in current WPML core.

- Why cleanup might incorrectly classify “duplicates”
- WPML evaluates duplicate-ness using the attachment’s own texts (caption, description, and the attachment’s alt meta), not the alt/caption you see inside blocks. If you translate alt in the block only (not in the media library/attachment), the attachment-level texts may still look identical to the source, and the cleanup may consider the translated attachment redundant.
- Your default language is Danish but you create in English. That can increase mapping edge cases (TRIDs/“duplicate-of” links), especially with the automatic media handling introduced in 4.8. That, plus ATE’s asynchronous saves, can make this feel intermittent.

- Why turning off “Automatically detect best options for translating image texts” didn’t stop it
- That toggle doesn’t fully disable the duplicate cleanup.

- On ATE updates
- ATE (the editor) is hosted and updated independently. The behavior change most relevant here came with WPML 4.8’s media/cleanup logic (“automatic image and media detection”). That’s the likely factor, not an ATE change per se.

Best Regards,
Otto

September 26, 2025 at 1:30 pm #17436149

Natalie Wood

Thanks

*can you advise how to get the previous versions of the WPML plugins - I don't see that option in the "commercial tab"

You have said that "unchecking 'When deleting a post, delete translations as well' won't stop image deletes"

However from the backtrace the call to delete the attachment is coming via:
sitepress-multilingual-cms/inc/post-translation/wpml-post-synchronization.class.php,
Line: 128, Function: WPML_Post_Synchronization->delete_translations

The code around line 128 is:

if ( $this->sync_delete || Lst::includes( $post_type, [ 'wp_template', 'wp_template_part' ] ) ) {
$this->delete_translations( $translated_ids, $keep_db_entries );
}

To me it seems the value of $this->sync_delete is set by:
$settings[ 'sync_delete' ]
*is this not the "When deleting a post, delete translations as well" setting?

There is a lot more I think I need to understand about images before I'm going to get to the bottom of this.

So I've just uploaded a new image in English language. I see that is ISN'T duplicated into Danish language

Then I added the image to a page and translated the page. Then I see that the image IS duplicated into the Danish language i.e. there is a post for it.
*Is this the correct behaviour?

I did translate the ALT text in the page but the duplicated image doesn't get the translated ALT text.
*So what is the use of the duplicate at that point?

You say that:

"Your default language is Danish but you create in English. That can increase mapping edge cases (TRIDs/“duplicate-of” links),"

*Does this mean the WPML doesn't support creating content in the non-default language?

Further to all this there seem to be some inconsistent post-attachment records in the ICL-translations table. These are recent and I suspect they are caused by the images being deleted. They may be part of the problem but I notice in the live database that there aren't any inconsistent records but it also suffered from deleted images. I've attached an image of some of the inconsistent records.
*Can you think how this would happen?

Even if I roll back the WPML plugins on my live site, I will have to keep trying to resolve this on dev . I will keep testing but as it is difficult to replicate the error it may take some time. *Can we keep this issue open?

records.png
September 26, 2025 at 3:11 pm #17436627

Otto
WPML Supporter since 09/2015

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

Timezone: America/Argentina/Buenos_Aires (GMT-03:00)

Hello,

You can get previous versions going to wpml.org/downloads, expand "Download manually" and the click on the changelog icon for each plugin. Check the screenshot attached, please.

Yes, the behavior is correct, with the latest version attachments are not duplicated until it's needed.

About, creating content in non-default language. It's supported, I meant that in a complex setup it may increase the chance of failure. But we need to understand how it's failing.

Yes, the ticket will remain open for 2 weeks without activity.

About the code you are pointing as the root cause of the problem. I am not sure... As far as I know, when dealing with attachments, WPML does not handle physical files, it handles them at the DB level. But I'd like to take a better look at the issue. Is it possible for you to provide me with a copy of the site? You can use Duplicator or just a DB dump and the wp-content folder. I am enabling a private reply in case it's OK, so you can share a download link safely. If not, I'd try to reproduce it on a test environment.

Best Regards,
Otto

CleanShot 2025-09-26 at 11.44.05.png
September 29, 2025 at 1:23 pm #17441144

Otto
WPML Supporter since 09/2015

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

Timezone: America/Argentina/Buenos_Aires (GMT-03:00)

Hello,

Thanks.

I managed to deploy the copy of your site locally.

I noted a warning message (check the screenshot attached):
"WPML Media is enabled but not effective. It requires WPML in order to work."

But WPML is active.

Do you also see it? Just checking if it's a problem of the migration or if it may be an issue.

Best Regards,
Otto

CleanShot 2025-09-29 at 10.19.54@2x.png
September 29, 2025 at 1:48 pm #17441338

Natalie Wood

No i don't have that message on my site.

Is it just because of the sitekey that you need to update. My sitekey won't work on your install

September 29, 2025 at 6:13 pm #17442100

Otto
WPML Supporter since 09/2015

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

Timezone: America/Argentina/Buenos_Aires (GMT-03:00)

Hello,

I spent some time trying to reproduce the problem with no luck 🙁

I tried in the copy of your site, in the pages that you mentioned, and also tried in a fresh installation. I couldn't reproduce the problem.

I analyzed the code with the help of AI. According to it, these are the conditions to make it happen and how to mitigate it:

When can images get deleted?
Trigger: After translating with ATE and then visiting specific admin screens (notably Media → Library). WPML’s automatic-media handling runs a cleanup that removes “duplicated copied” attachment translations.
Deletion path: It deletes a translated attachment record and fires a delete_post hook; if “Delete translations when deleting a post” is enabled, WPML may cascade-delete the other attachment translations using wp_delete_post, which for attachments calls wp_delete_attachment and removes the physical file.

Required conditions for deletion
WPML 4.8+ automatic media handling is enabled.
The attachment exists as translations (same TRID) across languages.
The attachment is classified as copied for the source post (in copied_media_ids); referenced media are not targeted.
Image texts are identical across languages: alt (wp_attachment_image_alt), caption (post_excerpt), and description (post_content). If they match exactly, the non-default-language translation is considered a duplicate and is deleted.
The global setting “Delete translations when deleting a post” is enabled (this enables the cascade that can lead to physical file deletion).
The cleanup is actually triggered (e.g., by opening Media → Library or the WPML media screen).

Not deleted if:
Automatic media handling is disabled.
The image is only referenced (not copied) in the post.
Any of alt/caption/description differ between languages.
“Delete translations when deleting a post” is disabled (then no cascade to wp_delete_attachment).
Why it can feel random
The cleanup runs on certain admin screens, not immediately after translation.
Whether an image is classified as copied vs referenced can vary with small content changes or how the block stores media.
ATE may sometimes set texts differently, breaking the “identical texts” condition.

I tried these conditions without luck, and you also tried disabling automatic media handling, so I have doubts about its accuracy.

Does this point you to any pattern that may help us find clear steps to reproduce the problem?

Best Regards,
Otto

October 1, 2025 at 6:18 am #17447178

Natalie Wood

Thanks Otto

OK that all makes sense.

* So disabling “Delete translations when deleting a post” should actually resolve the problem.

Obviously this doesn't fix the root cause but it should allow my live site to function correctly without fear of losing images during translation.

* As regards the 'copied' status of an image, it seems to be a bit random.
I have attached an image from the WPML media translation screen
It shows that some images are 'copied' and some aren't. What situations decide whether an image is 'copied' or not an what is the relevance. Note that ALL images are showing randomly as copied or not regardless of when they were added to the site and what page they are on.

All these images are added in the same way: Added in the Media screen first and then added to a page that is then translated.

I have added another image "copied-images.png" I can see the difference between them. The one that is copied obviously had a typo in the English alt text which I later went back and corrected, but that correction didn't change the alt text in the Danish image (which has the original English alt text with typo) - so now it is showing as copied.

What is the status of the images that don't have 'copied' next to them? Those images do appear in both languages in the Media screen so they are 'copied' as far as I can see.

*Could that be the issue that the image hasn't got a correct status?

* Did the 'copied' attribute exist before the latest WPML update? i.e. did the update go through and assign the 'copied' status retrospectively?

Note that I have never used the WPML media translation screen before. All translations of alt text etc have been done in the page.

* In your code analysis it says:
" If they match exactly, the non-default-language translation is considered a duplicate and is deleted."
I wonder if this is part of the problem? All my images are added in the non-default language.

* Another thing is that I always remove the 'title' from all my images. But it seems that the Danish images retained the title (but that was never used in the front end as inserting the English image, inserts it without a title, so that is not part of the translation)

Now however, since the image is not duplicated until it is added to a post, then the Danish image now has no title as well (I'm not sure if this is relevant but it is a change).

Note that all the images that were deleted were added before the update to the WPML plugins though.

*My suggestion is that the issue is that the image attachment record is being removed from the database for both languages and then obviously deleting the physical file is a logical next step in the code.
So maybe we should be looking at why the image attachment records are being deleted?

Perhaps one of the devs could have a closer look at the code??

copied-images.png
wpml-media-translation.png
October 1, 2025 at 1:12 pm #17448952

Otto
WPML Supporter since 09/2015

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

Timezone: America/Argentina/Buenos_Aires (GMT-03:00)

Hello,

Thanks.

Before escalating to our devs I need to understand the steps to recreate the issue. We are getting closer, I think.

About the image classification:

- **Copied image (duplicated)**: WPML creates a new `attachment` post per language (new DB ID) that points to the same physical file in `uploads`. You can localize title, caption, alt text, and slug per language. The file isn’t duplicated, only the record and its metadata.
- **Referenced image**: No `attachment` is created in the target language. Translated content uses the original `attachment`/URL. Metadata isn’t localized; it falls back to the source language.

When is it classified?

- **Not at upload time**: Uploading creates a single `attachment` in the current admin language (usually the default). No per-language copy is made yet.
- **At usage/duplication time**:
- When you add the image to a translated post or duplicate a post:
- If “Duplicate media for translated content” and/or “Duplicate featured images” is ON → WPML creates per‑language `attachment` posts → the image is classified as **copied**.
- If those are OFF (or `attachment` is set to fallback) → the translation uses the original attachment/URL → **referenced**.
- When you run the bulk tool in WPML → Media Translation → it creates the per‑language attachments at that moment → **copied**.

- **TL;DR**: Classification happens when the media is associated with translated content or duplication tools run—not when the file is uploaded.

This is new, from 4.8.

You mentioned that the images are "... added in the Media screen first and then added to a page that is then translated". And you also mention that they are added in the secondary language. By this you mean that when uploading the image you switched to the secondary language in the admin? Or you uploaded them in the original, duplicated the images, and then created a post in the secondary language and used them? What options did you have before updating in WPML > Settings > Media translation?

Best Regards,
Otto

October 6, 2025 at 6:43 am #17458223

Natalie Wood

1.
I added some images to a post on my live site and then translated.

Unfortunately I have no diagnostics running on my live site, but before I did the translation I looked at the images in the WPML translation editor and then after as well

Attached are the before and after images.
media-before-translation.png
media-after-translation.png

See that I uploaded the images in the English language and before I added them to the post they are showing correctly as only existing in English (as original language) and are not copied.

After I did the translation they are showing as only Existing in Danish as original language and 'copied' but there isn't a copy!

BUT see these images attached below
image-after-translation.png
image-before-translation.png

They show another image that I had uploaded and added to the post in exactly the same way as the other two but after translation it has NOT had the 'original' language changed from English to Danish.

Is it the correct behavior for the original language to be changed on some images?
There is definitely an inconsistency there.

I definitely DO NOT want that behaviour as I work with all images in English and having some of them swapped to being in the Danish language as original makes it impossible to keep track of images.

If that is the correct behaviour then how would I turn it off?

2. Note that on the live site I have unchecked the ''Delete translations when deleting a post' setting to prevent image deletions.
I am wondering that if I had it turned on then those images that had their language swapped may have also been deleted?

3. re 'copied' images. I guess my main question was whether it is correct that in the WPML media translation editor, some images show with nothing in the 'media type' column

You say "- When you run the bulk tool in WPML → Media Translation → it creates the per‑language attachments at that moment → **copied**."

* what is the 'bulk tool' ?

4. To clarify re adding images:
the default language is Danish
Images are uploaded using the WordPress Media screen in English and an alt text is entered in English and the title is deleted

That is all that is done.

Then an image is used in a page (created in English)

Then the page is translated to Danish

5. Steps to recreate the issue

Edit a page
Update the translation

Unfortunately with these steps the issue only occurs randomly

6. re your question:
"What options did you have before updating in WPML > Settings > Media translation?"

There is only one option there now which is to either have
'Automatically detect best options for translating image texts (alt, caption, title)'
turned on or off

It was off when I first updated the wpml plugins and I set it to on

*Were there any other Media translation options there prior to WPML plugin update?

7. I have an activity log in my dev site
I notice that if I manually delete an image in the WordPress Media screen then two entries show in the activity log. One for deleting the English DB entry for the image and one for deleting the Danish DB entry for the image.

For the images that are being deleted by WPML the log only shows one entry for the image deletion - and it was for the Danish language entry in the Database.

So it would seem the English language entry is being deleted first presumably via SQL as it is not in the log and then the Danish entry (and file) subsequently deleted.

image-before-translation.png
image-after-translation.png
media-after-translation.png
media-before-translation.png
October 6, 2025 at 7:11 pm #17461835

Otto
WPML Supporter since 09/2015

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

Timezone: America/Argentina/Buenos_Aires (GMT-03:00)

Hello,

Thanks.

I am still unable to reproduce the problem 🙁

I escalated the issue to our second tier support, I'll get back to you as soon as I have news from them.

Best Regards,
Otto