Home › Forums › Support › filter category on blog This topic has 3 replies, 2 voices, and was last updated 3 years, 3 months ago by David. Viewing 4 posts - 1 through 4 (of 4 total) Author Posts February 1, 2023 at 3:29 am #2516798 Jusung Hello! I have made a couple of categories on my site. I don’t wanna show posts in the categories that starat with po and All. Is there a way to remove certain category in blog page? February 1, 2023 at 8:45 am #2517231 DavidStaff Customer Support Hi there, you can use the pre_get_posts hook in a PHP Snippet like so: add_action('pre_get_posts', 'exclude_category_posts'); function exclude_category_posts( $query ) { if( $query->is_main_query() && !is_admin() && !is_singular() ) { $query->set('cat', array( -22, -33 )); } } In this line you set the IDs of the categories you want to exclude: $query->set('cat', array( -22, -33 )); make sure to keep the - minus before each Id. February 1, 2023 at 10:01 pm #2517905 Jusung Thank you!! it works! February 2, 2023 at 2:06 am #2518229 DavidStaff Customer Support Glad to hear that! Author Posts Viewing 4 posts - 1 through 4 (of 4 total) You must be logged in to reply to this topic. Log In Username: Password: Keep me signed in Log In