Excluding pages from wp_query Home › Forums › Product Support Forums › Ajax Search Pro for WordPress Support › Excluding pages from wp_query This topic has 3 replies, 2 voices, and was last updated 5 years, 4 months ago by Ernest Marcinko. Viewing 4 posts - 1 through 4 (of 4 total) Author Posts January 19, 2021 at 2:20 pm #31206 uniconta18Participant Hi I will be having many search bars in my website and I do not wish to exclude some posts/page ids on each of them. I have always used the below code: if ( ! $query->is_admin && $query->is_search ) { $query->set( 'post__not_in', $pages_array ); } But this does not seem to be working with your plugin. Can you please help with this ? Thanks. January 19, 2021 at 2:51 pm #31209 Ernest MarcinkoKeymaster Hi, Sure, you are looking for the asp_query_args hook. The post_not_in key is the one to exclude pages. January 20, 2021 at 6:22 am #31219 uniconta18Participant Thanks. This worked 🙂 January 20, 2021 at 12:28 pm #31225 Ernest MarcinkoKeymaster You cannot access this content. 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