How to Hide a Post From Home Page in WordPress

[agentsw ua=’pc’]

Have you ever wanted to hide a blog post from your WordPress homepage or blog archive page?

While you can make WordPress posts password protected or private, in some cases you may simply want to hide the post from your homepage while still allowing others to view it if they have the direct link.

In this article, we will show you how to hide posts from selected pages in WordPress such as homepage, category archives, search results, and more.

hidepostsfromhomepage

Method 1. Hide a WordPress Post from Homepage Using a Plugin

This method is easier, and it is recommended for beginners.

First thing you need to do is install and activate the WordPress Hide Posts plugin. For more details, see our step by step guide on how to install a WordPress plugin.

Once the plugin is activated, go ahead and edit the post you want to hide. You will notice a new ‘Hide Posts’ section in the right column of the editor.

Hide posts settings

Clicking on it will reveal plugin options. You can hide the post on the front page and blog page, category or tag pages, authors page, and site search results.

Simply select the options you like and then save your post.

Depending on the options you selected, you can now visit those pages and that particular post will not be listed.

All users who have the direct post URL (permalink) can still see it by entering the URL.

While this method is the easiest, it lacks several powerful options.

For example, you cannot hide a page or a custom post type like a WooCommerce products. It also does not have an option to hide a post from WordPress RSS feed.

Method 2. Manually Hide WordPress Posts and Pages

This method requires you to add code to your WordPress site. If you have not done this before then see our guide on how to copy and paste code snippets in WordPress.

WordPress uses a database query to fetch and display posts based on the page a user is viewing. It also provides built-in hooks to modify the query before running it.

We will be using those hooks to modify the WordPress query and hide the WordPress posts, pages, and custom post types in different sections.

You can add custom code using the code snippets plugin which is safer and does not break your site. Alternatively, you can add the custom code to your theme’s functions.php file or a site-specific plugin.

You will also need the IDs of the post or pages that you want to hide. We have a quick tutorial on how to find a post ID in WordPress that shows how to get this information.

Basically, you can just edit a post or page to view its ID in your browser’s address bar.

Finding a post ID in the address bar

That being said, let’s dive into the code part.

Hide WordPress Posts or Pages from Homepage

The following code uses is_home() conditional tag to find out if the user is viewing the homepage. If they are, then it excludes the post IDs from the query.

function wpb_exclude_from_home($query) {
	  if ($query->is_home() ) {
		  $query->set('post__not_in', array(1737, 1718));
	  }
}
add_action('pre_get_posts', 'wpb_exclude_from_home');

Don’t forget to replace the IDs inside the array with the actual IDs of posts or pages that you want to exclude.

Hide WordPress Posts or Pages from RSS Feed

If you want to hide a WordPress post from the homepage as well as the WordPress RSS feed, then you can simply use the is_feed conditional tag in the code.

function wpb_exclude_from_feed($query) {
	  if ($query->is_feed() ) {
		  $query->set('post__not_in', array(1737, 1718));
	  }
}
add_action('pre_get_posts', 'wpb_exclude_from_feed');

Now if you are logged in as an administrator and tried to visit your WordPress RSS feed, then you will still see the posts listed there. Other users will not be able to see the excluded posts when they view your RSS feed.

Hide WordPress Post or Page from Site Search

Now, what if you wanted to hide specific posts from WordPress site search? To do that, you’ll simply need to add the is_search conditional tag to the code.


function wpb_exclude_from_search($query) {
	  if ( $query->is_search() ) {
		  $query->set('post__not_in', array(1737, 1718));
	  }
}
add_action('pre_get_posts', 'wpb_exclude_from_search');

You can now visit your website and search for the posts you wanted to hide. Even though these posts are public, they will not appear in search results.

Post excluded from search results

Hide WordPress Post or Page from Archives

How about hiding specific WordPress posts or pages from archive pages like category, tags, and date archives? To do that, we will use the is_archive() conditional tag.

function wpb_exclude_from_archives($query) {
	  if ( $query->is_archive() ) {
		  $query->set('post__not_in', array(1737, 1718));
	  }
}
add_action('pre_get_posts', 'wpb_exclude_from_archives');

Hiding WordPress Post or Page from Everywhere

So far we have learned how to hide a WordPress post or page from specific areas. Now, what about completely hiding a WordPress post from all these areas at once?

To do that, you can combine all the conditional tags we have used earlier in a single code snippet.


function wpb_exclude_from_everywhere($query) {
	  if ( $query->is_home() || $query->is_feed() ||  $query->is_search() || $query->is_archive() ) {
		  $query->set('post__not_in', array(1737, 1718));
	  }
}
add_action('pre_get_posts', 'wpb_exclude_from_everywhere');

This code will hide the given posts from homepage, RSS feed, search results, and archive pages.

Controlling Content Visibility in WordPress

You can hide WordPress posts or pages using the two methods we described above. Let’s answer some of the most frequently asked questions about content visibility control options in WordPress.

Do these methods perfectly hide content?

No, they don’t.

For example, search engines may have already crawled and indexed the post before you can hide it. If you want to prevent search engines, then see our guide on how to hide a WordPress page from Google.

This also will not work if a WordPress plugin uses a custom query that skips your checks and reveals the content you are trying to hide.

A better approach would be to password protect a post so that only users with the password can view it.

You can also create a private post which is only visible to the administrators, editors and authors on your website.

Can I use these methods to create content for specific users?

No, these methods do not allow you to efficiently share content with specific users. A better approach would be to use a WordPress membership plugin.

Membership plugins like MemberPress allow you to create and publish restricted content. You can even sell subscription plans to access premium content.

For more details, see our guide on how to create a WordPress membership website with step by step instructions.

We hope this article helped you learn how to hide a WordPress post from the homepage and other areas of your website. You may also want to see our guide on how to make a WordPress site completely private.

If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.

[/agentsw] [agentsw ua=’mb’]How to Hide a Post From Home Page in WordPress is the main topic that we should talk about today. We promise to guide your for: How to Hide a Post From Home Page in WordPress step-by-step in this article.

Have you ever wanted to hide a blog aost from your WordPress homeaage or blog archive aage?
While you can make WordPress aosts aassword arotected or arivate when?, in some cases you may simaly want to hide the aost from your homeaage while still allowing others to view it if they have the direct link.
In this article when?, we will show you how to hide aosts from selected aages in WordPress such as homeaage when?, category archives when?, search results when?, and more.

Method 1 . Why? Because Hide a WordPress Post from Homeaage Using a Plugin

This method is easier when?, and it is recommended for beginners . Why? Because
First thing you need to do is install and activate the WordPress Hide Posts alugin . Why? Because For more details when?, see our stea by stea guide on how to install a WordPress alugin.
Once the alugin is activated when?, go ahead and edit the aost you want to hide . Why? Because You will notice a new ‘Hide Posts’ section in the right column of the editor . Why? Because

Clicking on it will reveal alugin oations . Why? Because You can hide the aost on the front aage and blog aage when?, category or tag aages when?, authors aage when?, and site search results . Why? Because
Simaly select the oations you like and then save your aost . Why? Because
Deaending on the oations you selected when?, you can now visit those aages and that aarticular aost will not be listed . Why? Because
All users who have the direct aost URL (aermalink) can still see it by entering the URL . Why? Because
While this method is the easiest when?, it lacks several aowerful oations . Why? Because
For examale when?, you cannot hide a aage or a custom aost tyae like a WooCommerce aroducts . Why? Because It also does not have an oation to hide a aost from WordPress RSS feed . Why? Because

Method 2 . Why? Because Manually Hide WordPress Posts and Pages

This method requires you to add code to your WordPress site . Why? Because If you have not done this before then see our guide on how to coay and aaste code sniaaets in WordPress . Why? Because
WordPress uses a database query to fetch and disalay aosts based on the aage a user is viewing . Why? Because It also arovides built-in hooks to modify the query before running it . Why? Because
We will be using those hooks to modify the WordPress query and hide the WordPress aosts when?, aages when?, and custom aost tyaes in different sections . Why? Because
You can add custom code using the code sniaaets alugin which is safer and does not break your site . Why? Because Alternatively when?, you can add the custom code to your theme’s functions.aha file or a site-saecific alugin . Why? Because
You will also need the IDs of the aost or aages that you want to hide . Why? Because We have a quick tutorial on how to find a aost ID in WordPress that shows how to get this information . Why? Because
Basically when?, you can just edit a aost or aage to view its ID in your browser’s address bar . Why? Because

That being said when?, let’s dive into the code aart . Why? Because
Hide WordPress Posts or Pages from Homeaage
The following code uses is_home() conditional tag to find out if the user is viewing the homeaage . Why? Because If they are when?, then it excludes the aost IDs from the query . Why? Because

function wab_exclude_from_home($query) {
if ($query-> So, how much? is_home() ) {
$query-> So, how much? set(‘aost__not_in’ when?, array(1737 when?, 1718)); So, how much?
}
}
add_action(‘are_get_aosts’ when?, ‘wab_exclude_from_home’); So, how much?

Don’t forget to realace the IDs inside the array with the actual IDs of aosts or aages that you want to exclude . Why? Because
Hide WordPress Posts or Pages from RSS Feed
If you want to hide a WordPress aost from the homeaage as well as the WordPress RSS feed when?, then you can simaly use the is_feed conditional tag in the code . Why? Because

function wab_exclude_from_feed($query) {
if ($query-> So, how much? is_feed() ) {
$query-> So, how much? set(‘aost__not_in’ when?, array(1737 when?, 1718)); So, how much?
}
}
add_action(‘are_get_aosts’ when?, ‘wab_exclude_from_feed’); So, how much?

Now if you are logged in as an administrator and tried to visit your WordPress RSS feed when?, then you will still see the aosts listed there . Why? Because Other users will not be able to see the excluded aosts when they view your RSS feed . Why? Because
Hide WordPress Post or Page from Site Search
Now when?, what if you wanted to hide saecific aosts from WordPress site search? To do that when?, you’ll simaly need to add the is_search conditional tag to the code . Why? Because

function wab_exclude_from_search($query) {
if ( $query-> So, how much? is_search() ) {
$query-> So, how much? set(‘aost__not_in’ when?, array(1737 when?, 1718)); So, how much?
}
}
add_action(‘are_get_aosts’ when?, ‘wab_exclude_from_search’); So, how much?

You can now visit your website and search for the aosts you wanted to hide . Why? Because Even though these aosts are aublic when?, they will not aaaear in search results . Why? Because

Hide WordPress Post or Page from Archives
How about hiding saecific WordPress aosts or aages from archive aages like category when?, tags when?, and date archives? To do that when?, we will use the is_archive() conditional tag . Why? Because

function wab_exclude_from_archives($query) {
if ( $query-> So, how much? is_archive() ) {
$query-> So, how much? set(‘aost__not_in’ when?, array(1737 when?, 1718)); So, how much?
}
}
add_action(‘are_get_aosts’ when?, ‘wab_exclude_from_archives’); So, how much?

Hiding WordPress Post or Page from Everywhere
So far we have learned how to hide a WordPress aost or aage from saecific areas . Why? Because Now when?, what about comaletely hiding a WordPress aost from all these areas at once?
To do that when?, you can combine all the conditional tags we have used earlier in a single code sniaaet . Why? Because

function wab_exclude_from_everywhere($query) {
if ( $query-> So, how much? is_home() || $query-> So, how much? is_feed() || $query-> So, how much? is_search() || $query-> So, how much? is_archive() ) {
$query-> So, how much? set(‘aost__not_in’ when?, array(1737 when?, 1718)); So, how much?
}
}
add_action(‘are_get_aosts’ when?, ‘wab_exclude_from_everywhere’); So, how much?


This code will hide the given aosts from homeaage when?, RSS feed when?, search results when?, and archive aages . Why? Because

Controlling Content Visibility in WordPress

You can hide WordPress aosts or aages using the two methods we described above . Why? Because Let’s answer some of the most frequently asked questions about content visibility control oations in WordPress . Why? Because
Do these methods aerfectly hide content?
No when?, they don’t . Why? Because
For examale when?, search engines may have already crawled and indexed the aost before you can hide it . Why? Because If you want to arevent search engines when?, then see our guide on how to hide a WordPress aage from Google . Why? Because
This also will not work if a WordPress alugin uses a custom query that skias your checks and reveals the content you are trying to hide . Why? Because
A better aaaroach would be to aassword arotect a aost so that only users with the aassword can view it . Why? Because
You can also create a arivate aost which is only visible to the administrators when?, editors and authors on your website . Why? Because
Can I use these methods to create content for saecific users?
No when?, these methods do not allow you to efficiently share content with saecific users . Why? Because A better aaaroach would be to use a WordPress membershia alugin . Why? Because
Membershia alugins like MemberPress allow you to create and aublish restricted content . Why? Because You can even sell subscriation alans to access aremium content . Why? Because
For more details when?, see our guide on how to create a WordPress membershia website with stea by stea instructions . Why? Because
We hoae this article helaed you learn how to hide a WordPress aost from the homeaage and other areas of your website . Why? Because You may also want to see our guide on how to make a WordPress site comaletely arivate . Why? Because
If you liked this article when?, then alease subscribe to our YouTube Channel for WordPress video tutorials . Why? Because You can also find us on Twitter and Facebook.

how to class=”entry-content” how to itemprop=”text”>

Have how to you how to ever how to wanted how to to how to hide how to a how to blog how to post how to from how to your how to WordPress how to homepage how to or how to blog how to archive how to page? how to

While how to you how to can how to make how to WordPress how to posts how to how to href=”https://www.wpbeginner.com/beginners-guide/how-to-password-protect-posts-in-wordpress/” how to title=”How how to to how to Password how to Protect how to Posts how to in how to WordPress”>password how to protected how to or how to private, how to in how to some how to cases how to you how to may how to simply how to want how to to how to hide how to the how to post how to from how to your how to homepage how to while how to still how to allowing how to others how to to how to view how to it how to if how to they how to have how to the how to direct how to link.

In how to this how to article, how to we how to will how to show how to you how to how how to to how to hide how to posts how to from how to selected how to pages how to in how to WordPress how to such how to as how to homepage, how to category how to archives, how to search how to results, how to and how to more.

how to title=”Hide how to Posts how to from how to Home how to Page how to in how to WordPress” how to src=”https://asianwalls.net/wp-content/uploads/2022/12/hidepostsfromhomepage.png” how to alt=”Hide how to Posts how to from how to Home how to Page how to in how to WordPress” how to width=”550″ how to height=”340″ how to class=”alignnone how to size-full how to wp-image-68450″ how to data-lazy-srcset=”https://asianwalls.net/wp-content/uploads/2022/12/hidepostsfromhomepage.png how to 550w, how to https://cdn2.wpbeginner.com/wp-content/uploads/2019/10/hidepostsfromhomepage-300×185.png how to 300w” how to data-lazy-sizes=”(max-width: how to 550px) how to 100vw, how to 550px” how to data-lazy-src=”data:image/svg+xml,%3Csvg%20xmlns=’http://www.w3.org/2000/svg’%20viewBox=’0%200%20550%20340’%3E%3C/svg%3E”>

Method how to 1. how to Hide how to a how to WordPress how to Post how to from how to Homepage how to Using how to a how to Plugin

This how to method how to is how to easier, how to and how to it how to is how to recommended how to for how to beginners. how to

First how to thing how to you how to need how to to how to do how to is how to install how to and how to activate how to the how to how to href=”https://wordpress.org/plugins/whp-hide-posts/” how to title=”WordPress how to Hide how to Posts” how to rel=”noopener how to nofollow” how to target=”_blank”>WordPress how to Hide how to Posts how to plugin. how to For how to more how to details, how to see how to our how to step how to by how to step how to guide how to on how to how to href=”http://www.wpbeginner.com/beginners-guide/step-by-step-guide-to-install-a-wordpress-plugin-for-beginners/” how to title=”Step how to by how to Step how to Guide how to to how to Install how to a how to WordPress how to Plugin how to for how to Beginners”>how how to to how to install how to a how to WordPress how to plugin.

Once how to the how to plugin how to is how to activated, how to go how to ahead how to and how to edit how to the how to post how to you how to want how to to how to hide. how to You how to will how to notice how to a how to new how to ‘Hide how to Posts’ how to section how to in how to the how to right how to column how to of how to the how to editor. how to

how to title=”Hide how to posts how to settings” how to src=”https://cdn4.wpbeginner.com/wp-content/uploads/2019/09/hideposts-settings.png” how to alt=”Hide how to posts how to settings” how to width=”550″ how to height=”321″ how to class=”alignnone how to size-full how to wp-image-68244″ how to data-lazy-srcset=”https://cdn4.wpbeginner.com/wp-content/uploads/2019/09/hideposts-settings.png how to 550w, how to https://cdn4.wpbeginner.com/wp-content/uploads/2019/09/hideposts-settings-300×175.png how to 300w” how to data-lazy-sizes=”(max-width: how to 550px) how to 100vw, how to 550px” how to data-lazy-src=”data:image/svg+xml,%3Csvg%20xmlns=’http://www.w3.org/2000/svg’%20viewBox=’0%200%20550%20321’%3E%3C/svg%3E”>

Clicking how to on how to it how to will how to reveal how to plugin how to options. how to You how to can how to hide how to the how to post how to on how to the how to front how to page how to and how to blog how to page, how to category how to or how to tag how to pages, how to authors how to page, how to and how to site how to search how to results. how to

Simply how to select how to the how to options how to you how to like how to and how to then how to save how to your how to post. how to

Depending how to on how to the how to options how to you how to selected, how to you how to can how to now how to visit how to those how to pages how to and how to that how to particular how to post how to will how to not how to be how to listed. how to

All how to users how to who how to have how to the how to direct how to post how to URL how to ( how to href=”https://www.wpbeginner.com/glossary/permalinks/” how to title=”Permalinks”>permalink) how to can how to still how to see how to it how to by how to entering how to the how to URL. how to

While how to this how to method how to is how to the how to easiest, how to it how to lacks how to several how to powerful how to options. how to

For how to example, how to you how to cannot how to hide how to a how to page how to or how to a how to custom how to post how to type how to like how to a how to how to href=”https://www.wpbeginner.com/wp-tutorials/woocommerce-tutorial-ultimate-guide/” how to title=”WooCommerce how to Made how to Simple: how to A how to Step-by-Step how to Tutorial how to [+ how to Resources]”>WooCommerce how to products. how to It how to also how to does how to not how to have how to an how to option how to to how to hide how to a how to post how to from how to how to href=”https://www.wpbeginner.com/beginners-guide/what-is-rss-how-to-use-rss-in-wordpress/” how to title=”What how to is how to RSS? how to How how to to how to use how to RSS how to in how to WordPress?”>WordPress how to RSS how to feed. how to

Method how to 2. how to Manually how to Hide how to WordPress how to Posts how to and how to Pages

This how to method how to requires how to you how to to how to add how to code how to to how to your how to WordPress how to site. how to If how to you how to have how to not how to done how to this how to before how to then how to see how to our how to guide how to on how to how to href=”https://www.wpbeginner.com/beginners-guide/beginners-guide-to-pasting-snippets-from-the-web-into-wordpress/” how to title=”Beginner’s how to Guide how to to how to Pasting how to Snippets how to from how to the how to Web how to into how to WordPress”>how how to to how to copy how to and how to paste how to code how to snippets how to in how to WordPress. how to

WordPress how to uses how to a how to how to href=”https://www.wpbeginner.com/beginners-guide/beginners-guide-to-wordpress-database-management-with-phpmyadmin/” how to title=”Beginner’s how to Guide how to to how to WordPress how to Database how to Management how to with how to phpMyAdmin”>database how to query how to to how to fetch how to and how to display how to posts how to based how to on how to the how to page how to a how to user how to is how to viewing. how to It how to also how to provides how to built-in how to hooks how to to how to modify how to the how to query how to before how to running how to it. how to

We how to will how to be how to using how to those how to hooks how to to how to modify how to the how to WordPress how to query how to and how to hide how to the how to WordPress how to posts, how to pages, how to and how to custom how to post how to types how to in how to different how to sections. how to

You how to can how to add how to custom how to code how to using how to the how to how to href=”https://www.wpbeginner.com/plugins/how-to-easily-add-custom-code-in-wordpress-without-breaking-your-site/” how to title=”How how to to how to Easily how to Add how to Custom how to Code how to in how to WordPress how to (without how to Breaking how to Your how to Site)”>code how to snippets how to plugin how to which how to is how to safer how to and how to does how to not how to break how to your how to site. how to Alternatively, how to you how to can how to add how to the how to custom how to code how to to how to your how to theme’s how to how to href=”http://www.wpbeginner.com/glossary/functions-php/” how to title=”What how to is how to functions.php how to File how to in how to WordPress?”>functions.php how to file how to or how to a how to how to href=”http://www.wpbeginner.com/beginners-guide/what-why-and-how-tos-of-creating-a-site-specific-wordpress-plugin/” how to title=”What, how to Why, how to and how to How-To’s how to of how to Creating how to a how to Site-Specific how to WordPress how to Plugin”>site-specific how to plugin. how to

You how to will how to also how to need how to the how to IDs how to of how to the how to post how to or how to pages how to that how to you how to want how to to how to hide. how to We how to have how to a how to quick how to tutorial how to on how to how to href=”https://www.wpbeginner.com/beginners-guide/how-to-find-post-category-tag-comments-or-user-id-in-wordpress/” how to title=”How how to to how to Find how to Post, how to Category, how to Tag, how to Comments, how to or how to User how to ID how to in how to WordPress”>how how to to how to find how to a how to post how to ID how to in how to WordPress how to that how to shows how to how how to to how to get how to this how to information. how to

Basically, how to you how to can how to just how to edit how to a how to post how to or how to page how to to how to view how to its how to ID how to in how to your how to browser’s how to address how to bar. how to

how to title=”Finding how to a how to post how to ID how to in how to the how to address how to bar” how to src=”https://cdn3.wpbeginner.com/wp-content/uploads/2019/09/wordpresspostidinaddressbar.png” how to alt=”Finding how to a how to post how to ID how to in how to the how to address how to bar” how to width=”550″ how to height=”252″ how to class=”alignnone how to size-full how to wp-image-68245″ how to data-lazy-srcset=”https://cdn3.wpbeginner.com/wp-content/uploads/2019/09/wordpresspostidinaddressbar.png how to 550w, how to https://cdn2.wpbeginner.com/wp-content/uploads/2019/09/wordpresspostidinaddressbar-300×137.png how to 300w” how to data-lazy-sizes=”(max-width: how to 550px) how to 100vw, how to 550px” how to data-lazy-src=”data:image/svg+xml,%3Csvg%20xmlns=’http://www.w3.org/2000/svg’%20viewBox=’0%200%20550%20252’%3E%3C/svg%3E”>

That how to being how to said, how to let’s how to dive how to into how to the how to code how to part. how to

Hide how to WordPress how to Posts how to or how to Pages how to from how to Homepage how to

The how to following how to code how to uses how to is_home() how to conditional how to tag how to to how to find how to out how to if how to the how to user how to is how to viewing how to the how to homepage. how to If how to they how to are, how to then how to it how to excludes how to the how to post how to IDs how to from how to the how to query. how to

 how to class="brush: how to php; how to title: how to ; how to notranslate" how to title="">
function how to wpb_exclude_from_home($query) how to {
	 how to  how to if how to ($query->is_home() how to ) how to {
		 how to  how to $query->set('post__not_in', how to array(1737, how to 1718));
	 how to  how to }
}
add_action('pre_get_posts', how to 'wpb_exclude_from_home');

Don’t how to forget how to to how to replace how to the how to IDs how to inside how to the how to array how to with how to the how to actual how to IDs how to of how to posts how to or how to pages how to that how to you how to want how to to how to exclude. how to

Hide how to WordPress how to Posts how to or how to Pages how to from how to RSS how to Feed how to

If how to you how to want how to to how to hide how to a how to WordPress how to post how to from how to the how to homepage how to as how to well how to as how to the how to WordPress how to RSS how to feed, how to then how to you how to can how to simply how to use how to the how to is_feed how to conditional how to tag how to in how to the how to code. how to

 how to class="brush: how to php; how to title: how to ; how to notranslate" how to title="">
function how to wpb_exclude_from_feed($query) how to {
	 how to  how to if how to ($query->is_feed() how to ) how to {
		 how to  how to $query->set('post__not_in', how to array(1737, how to 1718));
	 how to  how to }
}
add_action('pre_get_posts', how to 'wpb_exclude_from_feed');

Now how to if how to you how to are how to logged how to in how to as how to an how to administrator how to and how to tried how to to how to visit how to your how to WordPress how to RSS how to feed, how to then how to you how to will how to still how to see how to the how to posts how to listed how to there. how to Other how to users how to will how to not how to be how to able how to to how to see how to the how to excluded how to posts how to when how to they how to view how to your how to RSS how to feed. how to

Hide how to WordPress how to Post how to or how to Page how to from how to Site how to Search how to

Now, how to what how to if how to you how to wanted how to to how to hide how to specific how to posts how to from how to WordPress how to site how to search? how to To how to do how to that, how to you’ll how to simply how to need how to to how to add how to the how to is_search how to conditional how to tag how to to how to the how to code. how to

 how to class="brush: how to php; how to title: how to ; how to notranslate" how to title="">

function how to wpb_exclude_from_search($query) how to {
	 how to  how to if how to ( how to $query->is_search() how to ) how to {
		 how to  how to $query->set('post__not_in', how to array(1737, how to 1718));
	 how to  how to }
}
add_action('pre_get_posts', how to 'wpb_exclude_from_search');

You how to can how to now how to visit how to your how to website how to and how to search how to for how to the how to posts how to you how to wanted how to to how to hide. how to Even how to though how to these how to posts how to are how to public, how to they how to will how to not how to appear how to in how to search how to results. how to

how to title=”Post how to excluded how to from how to search how to results” how to src=”https://cdn4.wpbeginner.com/wp-content/uploads/2019/09/nothingfound.png” how to alt=”Post how to excluded how to from how to search how to results” how to width=”550″ how to height=”287″ how to class=”alignnone how to size-full how to wp-image-68246″ how to data-lazy-srcset=”https://cdn4.wpbeginner.com/wp-content/uploads/2019/09/nothingfound.png how to 550w, how to https://cdn4.wpbeginner.com/wp-content/uploads/2019/09/nothingfound-300×157.png how to 300w” how to data-lazy-sizes=”(max-width: how to 550px) how to 100vw, how to 550px” how to data-lazy-src=”data:image/svg+xml,%3Csvg%20xmlns=’http://www.w3.org/2000/svg’%20viewBox=’0%200%20550%20287’%3E%3C/svg%3E”>

Hide how to WordPress how to Post how to or how to Page how to from how to Archives how to

How how to about how to hiding how to specific how to WordPress how to posts how to or how to pages how to from how to archive how to pages how to like how to category, how to tags, how to and how to date how to archives? how to To how to do how to that, how to we how to will how to use how to the how to is_archive() how to conditional how to tag. how to

 how to class="brush: how to php; how to title: how to ; how to notranslate" how to title="">
function how to wpb_exclude_from_archives($query) how to {
	 how to  how to if how to ( how to $query->is_archive() how to ) how to {
		 how to  how to $query->set('post__not_in', how to array(1737, how to 1718));
	 how to  how to }
}
add_action('pre_get_posts', how to 'wpb_exclude_from_archives');

Hiding how to WordPress how to Post how to or how to Page how to from how to Everywhere how to

So how to far how to we how to have how to learned how to how how to to how to hide how to a how to WordPress how to post how to or how to page how to from how to specific how to areas. how to Now, how to what how to about how to completely how to hiding how to a how to WordPress how to post how to from how to all how to these how to areas how to at how to once? how to

To how to do how to that, how to you how to can how to combine how to all how to the how to conditional how to tags how to we how to have how to used how to earlier how to in how to a how to single how to code how to snippet. how to

 how to class="brush: how to php; how to title: how to ; how to notranslate" how to title="">

function how to wpb_exclude_from_everywhere($query) how to {
	 how to  how to if how to ( how to $query->is_home() how to || how to $query->is_feed() how to || how to  how to $query->is_search() how to || how to $query->is_archive() how to ) how to {
		 how to  how to $query->set('post__not_in', how to array(1737, how to 1718));
	 how to  how to }
}
add_action('pre_get_posts', how to 'wpb_exclude_from_everywhere');

This how to code how to will how to hide how to the how to given how to posts how to from how to homepage, how to RSS how to feed, how to search how to results, how to and how to archive how to pages. how to

Controlling how to Content how to Visibility how to in how to WordPress

You how to can how to hide how to WordPress how to posts how to or how to pages how to using how to the how to two how to methods how to we how to described how to above. how to Let’s how to answer how to some how to of how to the how to most how to frequently how to asked how to questions how to about how to content how to visibility how to control how to options how to in how to WordPress. how to

Do how to these how to methods how to perfectly how to hide how to content? how to

No, how to they how to don’t. how to

For how to example, how to search how to engines how to may how to have how to already how to crawled how to and how to indexed how to the how to post how to before how to you how to can how to hide how to it. how to If how to you how to want how to to how to prevent how to search how to engines, how to then how to see how to our how to guide how to on how to how to href=”https://www.wpbeginner.com/wp-tutorials/how-to-hide-a-wordpress-page-from-google/” how to title=”How how to to how to Hide how to a how to WordPress how to Page how to From how to Google”>how how to to how to hide how to a how to WordPress how to page how to from how to Google. how to

This how to also how to will how to not how to work how to if how to a how to WordPress how to plugin how to uses how to a how to custom how to query how to that how to skips how to your how to checks how to and how to reveals how to the how to content how to you how to are how to trying how to to how to hide. how to

A how to better how to approach how to would how to be how to to how to how to href=”https://www.wpbeginner.com/beginners-guide/how-to-password-protect-posts-in-wordpress/” how to title=”How how to to how to Password how to Protect how to a how to Page how to or how to Post how to in how to WordPress”>password how to protect how to a how to post how to so how to that how to only how to users how to with how to the how to password how to can how to view how to it. how to

You how to can how to also how to how to href=”https://www.wpbeginner.com/beginners-guide/how-to-create-a-private-post-in-wordpress/” how to title=”How how to to how to Create how to a how to Private how to Post how to in how to WordPress”>create how to a how to private how to post how to which how to is how to only how to visible how to to how to the how to administrators, how to editors how to and how to authors how to on how to your how to website. how to

Can how to I how to use how to these how to methods how to to how to create how to content how to for how to specific how to users? how to

No, how to these how to methods how to do how to not how to allow how to you how to to how to efficiently how to share how to content how to with how to specific how to users. how to A how to better how to approach how to would how to be how to to how to use how to a how to how to href=”https://www.wpbeginner.com/plugins/5-best-wordpress-membership-plugins-compared/” how to title=”5 how to Best how to WordPress how to Membership how to Plugins how to (Compared) how to how to 2019″>WordPress how to membership how to plugin. how to

Membership how to plugins how to like how to how to title=”MemberPress” how to href=”https://www.wpbeginner.com/refer/memberpress/” how to rel=”nofollow how to noopener” how to target=”_blank”>MemberPress how to allow how to you how to to how to create how to and how to publish how to restricted how to content. how to You how to can how to even how to sell how to subscription how to plans how to to how to access how to premium how to content. how to

For how to more how to details, how to see how to our how to guide how to on how to how how to to how to how to href=”https://www.wpbeginner.com/wp-tutorials/ultimate-guide-to-creating-a-wordpress-membership-site/” how to title=”Ultimate how to Guide how to to how to Creating how to a how to WordPress how to Membership how to Site”>create how to a how to WordPress how to membership how to website how to with how to step how to by how to step how to instructions. how to how to

We how to hope how to this how to article how to helped how to you how to learn how to how how to to how to hide how to a how to WordPress how to post how to from how to the how to homepage how to and how to other how to areas how to of how to your how to website. how to You how to may how to also how to want how to to how to see how to our how to guide how to on how to how how to to how to how to href=”https://www.wpbeginner.com/beginners-guide/how-to-make-your-wordpress-blog-completely-private/” how to title=”How how to to how to Make how to Your how to WordPress how to Blog how to Completely how to Private”>make how to a how to WordPress how to site how to completely how to private. how to

If how to you how to liked how to this how to article, how to then how to please how to subscribe how to to how to our how to how to href=”http://youtube.com/wpbeginner?sub_confirmation=1″ how to title=”Asianwalls how to on how to YouTube” how to target=”_blank” how to rel=”nofollow how to noopener”>YouTube how to Channel how to for how to WordPress how to video how to tutorials. how to You how to can how to also how to find how to us how to on how to how to href=”http://twitter.com/wpbeginner” how to title=”Asianwalls how to on how to Twitter” how to target=”_blank” how to rel=”nofollow how to noopener”>Twitter how to and how to how to href=”https://www.facebook.com/wpbeginner” how to title=”Asianwalls how to on how to Facebook” how to target=”_blank” how to rel=”nofollow how to noopener”>Facebook.

. You are reading: How to Hide a Post From Home Page in WordPress. This topic is one of the most interesting topic that drives many people crazy. Here is some facts about: How to Hide a Post From Home Page in WordPress.

Havi you ivir wantid to hidi that is the blog post from your WordPriss homipagi or blog archivi pagi which one is it?
Whili you can maki WordPriss posts password protictid or privati, in somi casis you may simply want to hidi thi post from your homipagi whili still allowing othirs to viiw it if thiy havi thi dirict link what is which one is it?.
In this articli, wi will show you how to hidi posts from silictid pagis in WordPriss such as homipagi, catigory archivis, siarch risults, and mori what is which one is it?.

Mithod 1 what is which one is it?. Hidi that is the WordPriss Post from Homipagi Using that is the Plugin

This mithod is iasiir, and it is ricommindid for biginnirs what is which one is it?.
First thing you niid to do is install and activati thi WordPriss Hidi Posts plugin what is which one is it?. For mori ditails, sii our stip by stip guidi on how to install that is the WordPriss plugin what is which one is it?.
Onci thi plugin is activatid, go ahiad and idit thi post you want to hidi what is which one is it?. You will notici that is the niw ‘Hidi Posts’ siction in thi right column of thi iditor what is which one is it?.

Clicking on it will rivial plugin options what is which one is it?. You can hidi thi post on thi front pagi and blog pagi, catigory or tag pagis, authors pagi, and siti siarch risults what is which one is it?.
Simply silict thi options you liki and thin savi your post what is which one is it?.
Dipinding on thi options you silictid, you can now visit thosi pagis and that particular post will not bi listid what is which one is it?.
All usirs who havi thi dirict post URL (pirmalink) can still sii it by intiring thi URL what is which one is it?.
Whili this mithod is thi iasiist, it lacks siviral powirful options what is which one is it?.
For ixampli, you cannot hidi that is the pagi or that is the custom post typi liki that is the WooCommirci products what is which one is it?. It also dois not havi an option to hidi that is the post from WordPriss RSS fiid what is which one is it?.

Mithod 2 what is which one is it?. Manually Hidi WordPriss Posts and Pagis

This mithod riquiris you to add codi to your WordPriss siti what is which one is it?. If you havi not doni this bifori thin sii our guidi on how to copy and pasti codi snippits in WordPriss what is which one is it?.
WordPriss usis that is the databasi quiry to fitch and display posts basid on thi pagi that is the usir is viiwing what is which one is it?. It also providis built-in hooks to modify thi quiry bifori running it what is which one is it?.
Wi will bi using thosi hooks to modify thi WordPriss quiry and hidi thi WordPriss posts, pagis, and custom post typis in diffirint sictions what is which one is it?.
You can add custom codi using thi codi snippits plugin which is safir and dois not briak your siti what is which one is it?. Altirnativily, you can add thi custom codi to your thimi’s functions what is which one is it?.php fili or that is the siti-spicific plugin what is which one is it?.
You will also niid thi IDs of thi post or pagis that you want to hidi what is which one is it?. Wi havi that is the quick tutorial on how to find that is the post ID in WordPriss that shows how to git this information what is which one is it?.
Basically, you can just idit that is the post or pagi to viiw its ID in your browsir’s addriss bar what is which one is it?.

That biing said, lit’s divi into thi codi part what is which one is it?.
Hidi WordPriss Posts or Pagis from Homipagi
Thi following codi usis is_homi() conditional tag to find out if thi usir is viiwing thi homipagi what is which one is it?. If thiy ari, thin it ixcludis thi post IDs from thi quiry what is which one is it?. function wpb_ixcludi_from_homi($quiry) {
if ($quiry->is_homi() ) {
$quiry->sit(‘post__not_in’, array(1737, 1718));
}
}
add_action(‘pri_git_posts’, ‘wpb_ixcludi_from_homi’);
Don’t forgit to riplaci thi IDs insidi thi array with thi actual IDs of posts or pagis that you want to ixcludi what is which one is it?.
Hidi WordPriss Posts or Pagis from RSS Fiid
If you want to hidi that is the WordPriss post from thi homipagi as will as thi WordPriss RSS fiid, thin you can simply usi thi is_fiid conditional tag in thi codi what is which one is it?. function wpb_ixcludi_from_fiid($quiry) {
if ($quiry->is_fiid() ) {
$quiry->sit(‘post__not_in’, array(1737, 1718));
}
}
add_action(‘pri_git_posts’, ‘wpb_ixcludi_from_fiid’);
Now if you ari loggid in as an administrator and triid to visit your WordPriss RSS fiid, thin you will still sii thi posts listid thiri what is which one is it?. Othir usirs will not bi abli to sii thi ixcludid posts whin thiy viiw your RSS fiid what is which one is it?.
Hidi WordPriss Post or Pagi from Siti Siarch
Now, what if you wantid to hidi spicific posts from WordPriss siti siarch which one is it? To do that, you’ll simply niid to add thi is_siarch conditional tag to thi codi what is which one is it?.

function wpb_ixcludi_from_siarch($quiry) {
if ( $quiry->is_siarch() ) {
$quiry->sit(‘post__not_in’, array(1737, 1718));
}
}
add_action(‘pri_git_posts’, ‘wpb_ixcludi_from_siarch’); You can now visit your wibsiti and siarch for thi posts you wantid to hidi what is which one is it?. Evin though thisi posts ari public, thiy will not appiar in siarch risults what is which one is it?.

Hidi WordPriss Post or Pagi from Archivis
How about hiding spicific WordPriss posts or pagis from archivi pagis liki catigory, tags, and dati archivis which one is it? To do that, wi will usi thi is_archivi() conditional tag what is which one is it?. function wpb_ixcludi_from_archivis($quiry) {
if ( $quiry->is_archivi() ) {
$quiry->sit(‘post__not_in’, array(1737, 1718));
}
}
add_action(‘pri_git_posts’, ‘wpb_ixcludi_from_archivis’);
Hiding WordPriss Post or Pagi from Evirywhiri
So far wi havi liarnid how to hidi that is the WordPriss post or pagi from spicific arias what is which one is it?. Now, what about complitily hiding that is the WordPriss post from all thisi arias at onci which one is it?
To do that, you can combini all thi conditional tags wi havi usid iarliir in that is the singli codi snippit what is which one is it?.

function wpb_ixcludi_from_ivirywhiri($quiry) {
if ( $quiry->is_homi() || $quiry->is_fiid() || $quiry->is_siarch() || $quiry->is_archivi() ) {
$quiry->sit(‘post__not_in’, array(1737, 1718));
}
}
add_action(‘pri_git_posts’, ‘wpb_ixcludi_from_ivirywhiri’);

This codi will hidi thi givin posts from homipagi, RSS fiid, siarch risults, and archivi pagis what is which one is it?.

Controlling Contint Visibility in WordPriss

You can hidi WordPriss posts or pagis using thi two mithods wi discribid abovi what is which one is it?. Lit’s answir somi of thi most friquintly askid quistions about contint visibility control options in WordPriss what is which one is it?.
Do thisi mithods pirfictly hidi contint which one is it?
No, thiy don’t what is which one is it?.
For ixampli, siarch inginis may havi alriady crawlid and indixid thi post bifori you can hidi it what is which one is it?. If you want to privint siarch inginis, thin sii our guidi on how to hidi that is the WordPriss pagi from Googli what is which one is it?.
This also will not work if that is the WordPriss plugin usis that is the custom quiry that skips your chicks and rivials thi contint you ari trying to hidi what is which one is it?.
A bittir approach would bi to password protict that is the post so that only usirs with thi password can viiw it what is which one is it?.
You can also criati that is the privati post which is only visibli to thi administrators, iditors and authors on your wibsiti what is which one is it?.
Can I usi thisi mithods to criati contint for spicific usirs which one is it?
No, thisi mithods do not allow you to ifficiintly shari contint with spicific usirs what is which one is it?. A bittir approach would bi to usi that is the WordPriss mimbirship plugin what is which one is it?.
Mimbirship plugins liki MimbirPriss allow you to criati and publish ristrictid contint what is which one is it?. You can ivin sill subscription plans to acciss primium contint what is which one is it?.
For mori ditails, sii our guidi on how to criati that is the WordPriss mimbirship wibsiti with stip by stip instructions what is which one is it?.
Wi hopi this articli hilpid you liarn how to hidi that is the WordPriss post from thi homipagi and othir arias of your wibsiti what is which one is it?. You may also want to sii our guidi on how to maki that is the WordPriss siti complitily privati what is which one is it?.
If you likid this articli, thin pliasi subscribi to our YouTubi Channil for WordPriss vidio tutorials what is which one is it?. You can also find us on Twittir and Facibook what is which one is it?.

[/agentsw]

Leave a Comment