WordPress删除重复的自定义字段

来自:互联网
时间:2020-03-21
阅读:

把自定义字段修改成你的,执行SQL就行,记得务必先备份数据库

delete from wp_postmeta
where meta_id in (
       select *
       from (
               select meta_id
               from wp_postmeta a
               where a.meta_key = '你的自定义字段'
               and meta_id not in (
                       select min(meta_id)
                       from wp_postmeta b
                       where b.post_id = a.post_id
                       and b.meta_key = '你的自定义字段'
               )
       ) as x
);
返回顶部
顶部