• Hi everybody and sorry for writing bad english,

    I created some categories and sub-categories for my blog. It now reads 211 posts, but when looking on the sidebar, I see there are only 208 posts in the “Rating”-category: This means I forgot to rate three posts. But when trying to manage the posts or the cagetories, I can only find posts that are assigned a certain category – I can’t find posts that don’t match. Is there a possibilty to find them INSIDE WP 2.5.1?
    And, if not, which query do I have to send in sql? I found the posts-table, but couldn’t find where the category/categories of the post are saved – maybe in a special table (term-taxonomy?), but I did not manage to understand that structure. I’m sure there is a simple sql-query that finds it – but I don’t. I just found the category-ids necessary for that query. Any helped is very welcome!

    Thanks in advance!

    Jan

Viewing 4 replies - 1 through 4 (of 4 total)
  • But can’t you see that in Manage->Categories, by clicking on the link represented by the number in the ‘Posts’ column?

    There is this SELECT you could use to list all post not in category 8:
    SELECT wp_posts.* FROM wp_posts INNER JOIN wp_term_relationships ON (wp_posts.ID = wp_term_relationships.object_id) INNER JOIN wp_term_taxonomy ON (wp_term_relationships.term_taxonomy_id = wp_term_taxonomy.term_taxonomy_id) WHERE wp_term_taxonomy.taxonomy = 'category' AND wp_term_taxonomy.term_id NOT IN ('8') AND wp_posts.post_type = 'post' AND (wp_posts.post_status = 'publish' OR wp_posts.post_status = 'private') GROUP BY wp_posts.ID ORDER BY wp_posts.post_date DESC

    Note: replace the wp_ with your $table_prefix value

    Thread Starter voiceofthenight

    (@voiceofthenight)

    Thanks MichaelH!

    I saw the clickable number in the “Posts” column, but what I want is finding the posts that DON’T match the category…

    The sql-query works fine but always returns ALL posts instead of giving me the ones which are not in category 8 … typing error or am I too stupid?

    Thanks in advance again!

    Jan

    I was hoping you could click on the other categories and look to figure out which posts should be ‘re-categorized’ to the Ratings category. The idea being the post you are looking for has to be in one of the ‘other’ categories.

    The SELECT works for me.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘How to find posts that DON’T match a certain category?’ is closed to new replies.