Created
November 10, 2023 07:18
-
-
Save SebKay/89e0f76a1b1aa57433355f9847a2e5c0 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
global $wpdb; | |
$duplicates = $wpdb->get_results("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 {$wpdb->postmeta} PM1, {$wpdb->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