我将问题中的链接重写为SQL
请记住,此脚本还将清除分配给页面的页面模板。
备份wp_postmeta
首先是表格。
DELETE pm
FROM wp_postmeta pm LEFT JOIN wp_posts p ON pm.post_id = p.id
WHERE
(p.post_type IN (\'post\', \'page\') AND pm.meta_key <> \'_thumbnail_id\')
OR (p.post_type = \'attachment\' AND pm.meta_key <> \'_wp_attached_file\'
AND pm.meta_key <> \'_wp_attachment_metadata\')