Bulk action via MySQL query: render all posts in category private

I want to do a bulk action on WordPress posts from a specific category:
I want to render all posts in the category private.

This MySQL query seems close, but it isn’t working
(I think I’m getting the parenthetical point wrong):

UPDATE wp_posts SET post_status= 'private' WHERE post_staus = 'publish' and ID in (select object_id from wp_term_relationships where term_taxonomy_id  = 25);

Related posts

Leave a Reply

1 comment