DISQUS

Blog by Andrea Olivato: Private: Clean Wordpress Database removing empty categories

  • Steve "The IT Juggler" Ollis · 1 month ago
    Thanks so MUCH for this post. I had a stack of tags get autogenerated by a plugin gone nuts, and ended up with over 5000 tags.. made WP sooooo slow. This fixed it for me.. I probably COULD have worked it out but Google found you first!

    A favour in return: I had a stack of comments laying around from posts that I had deleted. The following SQL allows you to find orphaned comments

    SELECT * FROM `wp__comments`
    WHERE NOT EXISTS (SELECT ID from wp_posts where wp_comments.comment_post_ID = wp_posts.ID)
  • Andrea Olivato · 1 month ago
    Thanks a lot, your SQL is terribly useful! I had orphaned comments too (and didn't know to)