wpnetbie
Member
Posted 3 years ago #
What code I must use in phpmyadmin for delete all post with No Tags.?????????
I have a blog with lot of posts, the important ones have tags, and those that are not interesting have not tags. So I need to delete all post with No Tags.
I know I can do it manually but I guess that with the correct code in phpmyadmin it can be done with a code. Anybody can help ?????
Thanks in advance for your help.
PS- I am using Wp 2.7
randinicole
Member
Posted 3 years ago #
Why not just sort the view by uncategorized, click check all and deleted the batch.
wpnetbie
Member
Posted 3 years ago #
thanks randinicole but all are categorized
randinicole
Member
Posted 3 years ago #
Blah lol :( read that wrong haha
davesgonebananas
Member
Posted 3 years ago #
DELETE FROM wp_posts WHERE wp_posts.post_type = 'post' AND wp_posts.post_status = 'publish' AND wp_posts.ID NOT IN (
SELECT DISTINCT wp_term_relationships.object_id
FROM wp_term_relationships
JOIN wp_term_taxonomy ON wp_term_relationships.term_taxonomy_id = wp_term_taxonomy.term_taxonomy_id
WHERE taxonomy = 'post_tag'
)
This will delete the posts without tags but it won't delete the revisions
wpnetbie
Member
Posted 3 years ago #
Thanks a lot davesgonebananas , you make my day. Congratulations !!!!
Also thanks randinicole for your very kind attention.
By the way: what code I must use in phpmyadmin for delete draft post without title, I mean with empty title (0 letters on title) ??????
Thanks again in advance.