Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Support Karan

    (@kjswp)

    Hi @hydn, if you are using the Live Ajax Search without the main SearchWP plugin then the search will be run using the default WordPress query_posts.

    You can use the following filter hook to customize the query_posts arguments and exclude pages by IDs. You can add this hook to your theme functions.php file.

    add_filter( 'searchwp_live_search_query_args', function( $args ) {
    	$args['post__not_in'] = [1, 2, 3]; // List all posts IDs that should be excluded from the search.
    	return $args;
    } );
    Thread Starter James

    (@hydn)

    Thanks, that works.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Exclude page IDs and post IDs’ is closed to new replies.