The answer here with the most upvotes is I think quite appropriate for this:
https://wordpress.stackexchange.com/questions/159302/show-posts-without-term
I am not aware of a way off PHP to do this.
If you’re using WordPress, you can use the following query in the MySQL database to retrieve all posts that don’t have a specific category:
SELECT * FROM wp_posts
LEFT JOIN wp_term_relationships ON (wp_posts.ID = wp_term_relationships.object_id)
WHERE wp_term_relationships.term_taxonomy_id IS NULL;
Replace wp_posts and wp_term_relationships with your own database table prefix, if it’s different.
Note: Before executing any queries on your database, make sure to backup your data.
Thread Starter
JanLho
(@janlho)
Hi guys, thank you for your replies. Unfortunately I have no clue on how to access or query a SQL DB. Any other possibilities?
Thread Starter
JanLho
(@janlho)
OK I’ve found a workaround: I exported all posts into a csv and was able to locate the one posts without certain category in the csv 😉
