Skip to content Skip to sidebar

Tagged: 

This topic contains 0 reply, has 0 voices.

Last updated by pavlosP-3 7 months ago.

Assisted by: Lauren.

Author Posts
October 2, 2025 at 3:42 pm #17452561

pavlosP-3

Background of the issue:
I am trying to batch delete all image files via WP-CLI that contain a specific filename because they were mistakenly uploaded in bulk. I want to ensure that the command follows best practices with WPML. Here is the command I plan to use: wp media delete $(wp media list --format=ids --name_like="image-filename-of-bulk-upload-") --force. We use WPML Multilingual CMS 4.6.15, WPML SEO 2.1.0.1, and WPML String Translation 3.2.18. We do not use WPML Media Translation plugin. I read this documentation: https://wpml.org/forums/topic/images-deleted-in-media-library-in-one-language-are-still-visible-in-other-ml/. We are open to enabling the option "When deleting a post, delete translations as well" if necessary before running the command.

Symptoms:
No specific issue or error message mentioned.

Questions:
Do you think this command will delete all proper WPML related entries as well, such as images in additional languages and related icl_translations entries?
Is it necessary to enable the option "When deleting a post, delete translations as well" before running the command to ensure all images are deleted in all languages?