Skip to content

Instantly share code, notes, and snippets.

@awojtczyk
Created September 13, 2016 21:00
Show Gist options
  • Save awojtczyk/2d0d31b1006f188896e9f34362686869 to your computer and use it in GitHub Desktop.
Save awojtczyk/2d0d31b1006f188896e9f34362686869 to your computer and use it in GitHub Desktop.
DELETE FROM wp_posts WHERE
ID IN
(
SELECT element_id FROM wp_icl_translations WHERE element_type = 'post_attachment' AND language_code != 'en'
)
DELETE FROM wp_postmeta WHERE
meta_key= '_thumbnail_id' AND meta_value IN
(
SELECT element_id FROM wp_icl_translations WHERE element_type = 'post_attachment' AND language_code != 'en'
)
DELETE FROM wp_icl_translations WHERE element_type = 'post_attachment' AND language_code != 'en';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment