admin管理员组文章数量:1023815
Over 2000 empty posts were created and I cannot delete them from the admin. Couldn't find them on SQL either using
SELECT *
FROM wp_posts a
LEFT JOIN wp_term_relationships b ON ( a.ID = b.object_id )
LEFT JOIN wp_postmeta c ON ( a.ID = c.post_id )
LEFT JOIN wp_term_taxonomy d ON ( d.term_taxonomy_id =
b.term_taxonomy_id )
LEFT JOIN wp_terms e ON ( e.term_id = d.term_id )
WHERE e.term_id = 1
Maybe they are _postmeta? How would you go to delete them?
Over 2000 empty posts were created and I cannot delete them from the admin. Couldn't find them on SQL either using
SELECT *
FROM wp_posts a
LEFT JOIN wp_term_relationships b ON ( a.ID = b.object_id )
LEFT JOIN wp_postmeta c ON ( a.ID = c.post_id )
LEFT JOIN wp_term_taxonomy d ON ( d.term_taxonomy_id =
b.term_taxonomy_id )
LEFT JOIN wp_terms e ON ( e.term_id = d.term_id )
WHERE e.term_id = 1
Maybe they are _postmeta? How would you go to delete them?
Share Improve this question asked May 7, 2019 at 15:52 stemonstemon 1551 silver badge8 bronze badges 1- wordpress/plugins/bulk-delete – Castiblanco Commented May 7, 2019 at 17:08
1 Answer
Reset to default 2They are definitely some sort of post - postmeta alone doesn't show up in the post listing screens like this. The fastest way to delete them would be to go to Screen Options to show more of the posts at once (say 500 per page so it doesn't time out) and use bulk actions to delete 500 at a time.
However, if you'd like to do things directly in the database:
You can run
SELECT * from wp_posts WHERE post_title = ''
to select all the posts that have no title. Once you have that list, you can delete the postmeta like this (replace 1,2,3 with your list of IDs, and replace wp_ prefix with your prefix):
DELETE from wp_postmeta WHERE post_id IN (1,2,3)
And you can delete the post's taxonomy associations like this (again replace 1,2,3 with your list of IDs, and replace wp_ prefix with your prefix):
DELETE from wp_term_relationships WHERE object_id IN (1,2,3)
Then don't forget to delete the posts themselves:
DELETE from wp_posts WHERE post_title = ''
Over 2000 empty posts were created and I cannot delete them from the admin. Couldn't find them on SQL either using
SELECT *
FROM wp_posts a
LEFT JOIN wp_term_relationships b ON ( a.ID = b.object_id )
LEFT JOIN wp_postmeta c ON ( a.ID = c.post_id )
LEFT JOIN wp_term_taxonomy d ON ( d.term_taxonomy_id =
b.term_taxonomy_id )
LEFT JOIN wp_terms e ON ( e.term_id = d.term_id )
WHERE e.term_id = 1
Maybe they are _postmeta? How would you go to delete them?
Over 2000 empty posts were created and I cannot delete them from the admin. Couldn't find them on SQL either using
SELECT *
FROM wp_posts a
LEFT JOIN wp_term_relationships b ON ( a.ID = b.object_id )
LEFT JOIN wp_postmeta c ON ( a.ID = c.post_id )
LEFT JOIN wp_term_taxonomy d ON ( d.term_taxonomy_id =
b.term_taxonomy_id )
LEFT JOIN wp_terms e ON ( e.term_id = d.term_id )
WHERE e.term_id = 1
Maybe they are _postmeta? How would you go to delete them?
Share Improve this question asked May 7, 2019 at 15:52 stemonstemon 1551 silver badge8 bronze badges 1- wordpress/plugins/bulk-delete – Castiblanco Commented May 7, 2019 at 17:08
1 Answer
Reset to default 2They are definitely some sort of post - postmeta alone doesn't show up in the post listing screens like this. The fastest way to delete them would be to go to Screen Options to show more of the posts at once (say 500 per page so it doesn't time out) and use bulk actions to delete 500 at a time.
However, if you'd like to do things directly in the database:
You can run
SELECT * from wp_posts WHERE post_title = ''
to select all the posts that have no title. Once you have that list, you can delete the postmeta like this (replace 1,2,3 with your list of IDs, and replace wp_ prefix with your prefix):
DELETE from wp_postmeta WHERE post_id IN (1,2,3)
And you can delete the post's taxonomy associations like this (again replace 1,2,3 with your list of IDs, and replace wp_ prefix with your prefix):
DELETE from wp_term_relationships WHERE object_id IN (1,2,3)
Then don't forget to delete the posts themselves:
DELETE from wp_posts WHERE post_title = ''
本文标签: databaseMultiples Empty Posts were created and cannot delete them
版权声明:本文标题:database - Multiples Empty Posts were created and cannot delete them 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://it.en369.cn/questions/1745515554a2154029.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论