Skip to content

Instantly share code, notes, and snippets.

@SebKay
Created November 10, 2023 07:18
Show Gist options
  • Save SebKay/5504e09f332af6c0bb71e16adbc0190f to your computer and use it in GitHub Desktop.
Save SebKay/5504e09f332af6c0bb71e16adbc0190f to your computer and use it in GitHub Desktop.
SELECT PM1.meta_id, PM1.post_id, PM1.meta_key, PM1.meta_value, PM2.meta_id, PM2.post_id, PM2.meta_key, PM2.meta_value
FROM wp_postmeta PM1, wp_postmeta PM2
WHERE
PM1.meta_id > PM2.meta_id
AND PM1.post_id = PM2.post_id
AND PM1.meta_value = PM2.meta_value
AND PM1.meta_key = PM2.meta_key
-- AND PM1.meta_key = '_wp_attachment_image_alt'
ORDER BY PM1.post_id ASC LIMIT 1000 OFFSET 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment