<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>WPWife &#187; exclude individual pages from wordpress search</title>
	<atom:link href="http://www.wpwife.com/category/exclude-individual-pages-from-wordpress-search/feed" rel="self" type="application/rss+xml" />
	<link>http://www.wpwife.com</link>
	<description>WPHelp: fix and optimise WP themes&#38;plugins</description>
	<lastBuildDate>Fri, 21 Nov 2025 12:00:00 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>https://wordpress.org/?v=4.1.38</generator>
	<item>
		<title>How to Exclude Specific Pages, Authors, and More from WordPress Search</title>
		<link>http://www.wpwife.com/wordpress-plugins/how-to-exclude-specific-pages-authors-and-more-from-wordpress-search</link>
		<comments>http://www.wpwife.com/wordpress-plugins/how-to-exclude-specific-pages-authors-and-more-from-wordpress-search#comments</comments>
		<pubDate>Thu, 28 Jun 2018 10:29:31 +0000</pubDate>
		<dc:creator><![CDATA[Editorial Staff]]></dc:creator>
				<category><![CDATA[exclude individual pages from wordpress search]]></category>
		<category><![CDATA[exclude specific authors from wordpress archive]]></category>
		<category><![CDATA[exclude specific authors from wordpress feed]]></category>
		<category><![CDATA[exclude specific authors from wordpress search]]></category>
		<category><![CDATA[exclude specific categories from wordpress archive]]></category>
		<category><![CDATA[exclude specific categories from wordpress search]]></category>
		<category><![CDATA[exclude specific pages from wordpress search]]></category>
		<category><![CDATA[exclude specific tags from wordpress archive]]></category>
		<category><![CDATA[exclude specific tags from wordpress search]]></category>
		<category><![CDATA[simply exclude plugin]]></category>
		<category><![CDATA[simply exclude specific pages from wordpress search]]></category>
		<category><![CDATA[WordPress Plugins]]></category>

		<guid isPermaLink="false">http://www.wpbeginner.com/?p=4940</guid>
		<description><![CDATA[
<p>Do you want to exclude specific pages, authors, and more from WordPress search? By default, WordPress search includes all posts and pages in the search results. In this article, we will show you how to easily exclude specific pages, posts, authors, categories, and more from&#8230;&#160;<strong><a href="http://www.wpbeginner.com/plugins/how-to-exclude-specific-pages-authors-and-more-from-wordpress-search/">Read More &#187;</a></strong></p>
<p>The post <a rel="nofollow" href="http://www.wpbeginner.com/plugins/how-to-exclude-specific-pages-authors-and-more-from-wordpress-search/">How to Exclude Specific Pages, Authors, and More from WordPress Search</a> appeared first on <a rel="nofollow" href="http://www.wpbeginner.com/">WPBeginner</a>.</p>
]]></description>
				<content:encoded><![CDATA[<p>Do you want to exclude specific pages, authors, and more from WordPress search? By default, WordPress search includes all posts and pages in the search results. In this article, we will show you how to easily exclude specific pages, posts, authors, categories, and more from WordPress search results. </p>
<p><img title="Exclude pages, authors, category, tag, and more from WordPress search" src="http://cdn.wpbeginner.com/wp-content/uploads/2018/04/wpsearchexclude.png" alt="Exclude pages, authors, category, tag, and more from WordPress search" width="550" height="340" class="alignnone size-full wp-image-52034" /></p>
<h4>Why Exclude Items from WordPress Search?</h4>
<p>The default WordPress search feature shows results from all WordPress posts, pages, and custom post types. This is acceptable for most websites and does not affect <a href="http://www.wpbeginner.com/wordpress-seo/" title="Ultimate WordPress SEO Guide for Beginners (Step by Step)">WordPress SEO</a> or performance. </p>
<p>However if you are <a href="http://www.wpbeginner.com/wp-tutorials/how-to-start-an-online-store/" title="How to Start an Online Store in 2018 (Step by Step)">running an online store</a>, then there are some pages that you may not want to appear in search results. For example, the checkout page, my account page, or a thank you page after successful downloads. </p>
<p>Similarly, if you are running a <a href="http://www.wpbeginner.com/wp-tutorials/ultimate-guide-to-creating-a-wordpress-membership-site/" title="Ultimate Guide to Creating a WordPress Membership Site">WordPress membership website</a>, or a <a href="http://www.wpbeginner.com/plugins/best-wordpress-lms-plugins-compared/" title="5 Best WordPress LMS Plugins Compared (Pros and Cons)">LMS plugin</a>, then there would be pages and <a href="http://www.wpbeginner.com/wp-tutorials/how-to-create-custom-post-types-in-wordpress/" title="How to Create Custom Post Types in WordPress">custom post types</a> on your website that you may want to exclude from search results. </p>
<p>Some website owners may want to hide a category or <a href="http://www.wpbeginner.com/glossary/taxonomy/" title="Taxonomy">taxonomy</a>, while others may want to hide posts from specific authors. Optimizing your site-search by excluding unnecessary items offers a better user experience and improves your website&#8217;s usability. </p>
<p>That being said, let&#8217;s take a look at how to easily exclude items from WordPress search. </p>
<h4>1. Exclude Specific Posts, Pages, and Custom Post Types from Search</h4>
<p>The first thing you need to do is install and activate the <a href="https://wordpress.org/plugins/search-exclude/"  title="Search Exclude" rel="nofollow">Search Exclude</a> plugin. For more details, see our step by step guide on <a href="http://www.wpbeginner.com/beginners-guide/step-by-step-guide-to-install-a-wordpress-plugin-for-beginners/" title="Step by Step Guide to Install a WordPress Plugin for Beginners">how to install a WordPress plugin</a>.</p>
<p>Upon activation, edit the post, page, or custom post type that you want to exclude from the search result. On the edit screen, you will see a search exclude box. </p>
<p><img title="Exclude from search box" src="http://cdn4.wpbeginner.com/wp-content/uploads/2018/04/excludesearch.png" alt="Exclude from search box " width="550" height="258" class="alignnone size-full wp-image-52029" /></p>
<p>Simply check &#8216;Exclude from Search Results&#8217; checkbox and don&#8217;t forget to save your post/page. This particular post/page will not appear in WordPress search results anymore. </p>
<p>To view all the items that you have excluded from search, go to <strong>Settings &raquo; Search Exclude</strong> page. Here you will see a list of items you have excluded from WordPress search results. </p>
<p><img title="Content you have excluded from WordPress search" src="http://cdn3.wpbeginner.com/wp-content/uploads/2018/04/excludedposts.png" alt="Content you have excluded from WordPress search" width="550" height="340" class="alignnone size-full wp-image-52030" /></p>
<p>If you want to remove the restriction, simply uncheck the box next to the item you want to add back and click on the save changes button. </p>
<h4>2. Exclude Specific Category, Tag, Custom Taxonomy From WordPress Search</h4>
<p>This method requires you to add code to your WordPress website. If you haven&#8217;t done this before, then check out our guide on <a href="http://www.wpbeginner.com/beginners-guide/beginners-guide-to-pasting-snippets-from-the-web-into-wordpress/" title="Beginner’s Guide to Pasting Snippets from the Web into WordPress">how to copy and paste code snippets in WordPress</a>. </p>
<p>First, you need to <a href="http://www.wpbeginner.com/beginners-guide/how-to-find-post-category-tag-comments-or-user-id-in-wordpress/" title="How to Find Post, Category, Tag, Comments, or User ID in WordPress">find the category ID</a> that you want to exclude. </p>
<p>Next, you need to add the following code to your theme&#8217;s <a href="http://www.wpbeginner.com/glossary/functions-php/" title="What is functions.php File in WordPress?">functions.php</a> file or a <a href="http://www.wpbeginner.com/beginners-guide/what-why-and-how-tos-of-creating-a-site-specific-wordpress-plugin/" title="What, Why, and How-To’s of Creating a Site-Specific WordPress Plugin">site-specific plugin</a>. </p>
<pre class="brush: php; title: ; notranslate">

function wpb_search_filter( $query ) {
	if ( $query-&gt;is_search &amp;&amp; !is_admin() )
		$query-&gt;set( 'cat','-7' );
	return $query;
}
add_filter( 'pre_get_posts', 'wpb_search_filter' );
</pre>
<p>Don&#8217;t forget to replace 7 with the ID of category you want to exclude. </p>
<p>Now, let&#8217;s suppose you want to exclude more than one category. This is how you will modify the code to exclude multiple categories. </p>
<pre class="brush: php; title: ; notranslate">
function wpb_search_filter( $query ) {
	if ( $query-&gt;is_search &amp;&amp; !is_admin() )
		$query-&gt;set( 'cat','-7, -10, -21' );
	return $query;
}
add_filter( 'pre_get_posts', 'wpb_search_filter' );
</pre>
<p>We have simply added the category IDs that we want to exclude separated by commas. </p>
<p><strong>Exclude Specific Tags from WordPress Search</strong> </p>
<p>If you want to exclude posts filed under specific tag, then you can use the following code. </p>
<pre class="brush: php; title: ; notranslate">
if ( $query-&gt;is_search &amp;&amp; !is_admin() )
		$query-&gt;set( 'tag','-19' );
	return $query;
}
add_filter( 'pre_get_posts', 'wpb_search_filter' );
</pre>
<p>Don&#8217;t forget to replace 19 with the ID of tag you want to exclude. </p>
<p>Similarly, you can modify the code to exclude multiple tags as well. </p>
<pre class="brush: php; title: ; notranslate">
if ( $query-&gt;is_search &amp;&amp; !is_admin() )
		$query-&gt;set( 'tag','-19, -27, -56' );
	return $query;
}
add_filter( 'pre_get_posts', 'wpb_search_filter' );
</pre>
<p><strong>Excluding Specific Terms in a Custom Taxonomy From WordPress Search</strong> </p>
<p>If you want to exclude a term in a custom taxonomy from WordPress search results, then you will need to add the following code. </p>
<pre class="brush: php; title: ; notranslate">

function wpb_modify_search_query( $query ) {
	global $wp_the_query;
	if( $query === $wp_the_query &amp;&amp; $query-&gt;is_search() ) {
		$tax_query = array(
			array(
				'taxonomy' =&gt; 'genre',
				'field' =&gt; 'slug',
				'terms' =&gt; 'action',
				'operator' =&gt; 'NOT IN',
			)
		);
		$query-&gt;set( 'tax_query', $tax_query );
	}
}
add_action( 'pre_get_posts', 'wpb_modify_search_query' );

</pre>
<p>Don&#8217;t forget to replace &#8216;genre&#8217; with the custom taxonomy and &#8216;action&#8217; with the term you want to exclude. </p>
<h4>3. Exclude Specific Author From WordPress Search</h4>
<p>If you want to exclude posts created by a specific author from WordPress search result, then there are two ways to do that. </p>
<p>If the author has just a few posts, and you are sure they will not be adding any more posts, then you can just use the first method in this article to exclude their posts from WordPress search. </p>
<p>However if there are a lot of posts written by an author, then you can use the following code to exclude all of them from WordPress search results. </p>
<pre class="brush: php; title: ; notranslate">
function wpb_search_filter( $query ) {
	if ( $query-&gt;is_search &amp;&amp; !is_admin() )
		$query-&gt;set( 'author','-24' );
	return $query;
}
add_filter( 'pre_get_posts', 'wpb_search_filter' );
</pre>
<p>Don&#8217;t forget to replace 24 with the user ID of the author you want to exclude. </p>
<p>You can also use the same code to exclude multiple authors by adding their user IDs separated by comma. </p>
<pre class="brush: php; title: ; notranslate">
function wpb_search_filter( $query ) {
	if ( $query-&gt;is_search &amp;&amp; !is_admin() )
		$query-&gt;set( 'author','-24, -12, -19' );
	return $query;
}
add_filter( 'pre_get_posts', 'wpb_search_filter' );
</pre>
<p>We hope this article helped you learn how to explude specific pages, authors, and more from WordPress search. You may also want to see our list of the <a href="http://www.wpbeginner.com/showcase/12-wordpress-search-plugins-to-improve-your-site-search/" title="12 WordPress Search Plugins to Improve Your Site Search">best WordPress search plugins</a> to improve your site search.</p>
<p>If you liked this article, then please subscribe to our <a href="http://youtube.com/wpbeginner?sub_confirmation=1" title="WPBeginner on YouTube"  rel="nofollow">YouTube Channel</a> for WordPress video tutorials. You can also find us on <a href="http://twitter.com/wpbeginner" title="WPBeginner on Twitter"  rel="nofollow">Twitter</a> and <a href="https://www.facebook.com/wpbeginner" title="WPBeginner on Facebook"  rel="nofollow">Facebook</a>. </p>
<p>The post <a rel="nofollow" href="http://www.wpbeginner.com/plugins/how-to-exclude-specific-pages-authors-and-more-from-wordpress-search/">How to Exclude Specific Pages, Authors, and More from WordPress Search</a> appeared first on <a rel="nofollow" href="http://www.wpbeginner.com/">WPBeginner</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.wpwife.com/wordpress-plugins/how-to-exclude-specific-pages-authors-and-more-from-wordpress-search/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
<enclosure url="" length="0" type="" />
		</item>
	</channel>
</rss>
