database - Multiples Empty Posts were created and cannot delete them

Over 2000 empty posts were created and I cannot delete them from the admin. Couldn't find them on SQL either using

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
Add a comment  | 

1 Answer 1

Reset to default 2

They 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 = ''

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745515555a4630974.html

相关推荐

  • database - Multiples Empty Posts were created and cannot delete them

    Over 2000 empty posts were created and I cannot delete them from the admin. Couldn't find them on SQL either using

    20小时前
    40

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信