How to clean wp_postmeta from duplicated rows for same post_id
-
Hello,
due some errors in product duplicating when product contain some custom postmeta fields now I have some products with a lot of repeated similar rows for same product.I need to clear wp_postmeta table but have very few MySQL knowledge. Could any one help how can I make it via phpmyAdmin?
The table rows that I want to clean look like:
[meta_id] [post_id] [meta_key] [meta_value]
[1111111] [9999999] [_wpbcode] [css……]
[2222222] [9999999] [_wpbcode] [css……]
[3333333] [9999999] [_wpbcode] [css……]
[4444444] [9999999] [_wpbcode] [css……]
[5555555] [9999999] [_wpbcode] [css……]So these rows are different by meta_id only. I need to find all these rows which are have SAME post_id SAME meta_key and SAME meta_value simultaneously and drop all these rows except one single line. These row are absolutely identical. Will be remaining row has highest meta_id or lowest is not important.
Thanks in advance!
- The topic ‘How to clean wp_postmeta from duplicated rows for same post_id’ is closed to new replies.