Is your WordPress theme showing your latest content on the homepage by default?
Do you want to change that?
In this simple tutorial, you’ll learn how to hide a post on your homepage.
Ready to get started?
Let’s do this.
Why do people hide posts?
Having the latest content show up on your homepage might sound like a good idea.
But there are lots of reasons why it might not be the best tactic.
Here are a few “for instances”:
What if your latest post is by a guest blogger and you’d rather feature your own content?
What if you want to display your most popular content instead of the most recent?
What if your latest post is highly controversial and you don’t want to risk putting off new visitors?
These are all valid reasons for hiding posts.
Whatever your reasons, here’s a couple of different ways to hide a post on your WordPress site’s homepage.
How to hide a post from your WordPress homepage – the manual method.
If you’re a confident WordPress user and you’re happy to add custom code to your site then follow this method.
Beginners might want to scroll down to the plugin method below as that’s a bit easier.
If you’re ok working with code, you can hide a post from your homepage by adding the following code to your theme’s functions.php file.
Add the code below to the end of the functions.php file just before the “?>” part:
You will need to replace the -xx with the specific ID’s of the posts (or pages) you want to hide.
You can find the ID’s for specific posts by clicking Posts then All Posts from your WordPress dashboard:
Click Edit as shown above, and then from the WordPress editor you should be able to see the URL which contains the individual post number.
It will say post=NUMBER. That’s your unique post ID number.
Here’s what you’re looking for:
You can use this same technique to hide pages which will show as Page=NUMBER.
Gather up all of the ID’s for the posts (or pages) you want to hide then insert them into the code replacing the -xx, or add them as array numbers using ‘post__not_in’ as in the example below:
How to hide a post from your WordPress homepage: the plugin method.
By far the easiest way to control what people see on your WordPress homepage is to use a plugin.
The WP Hide post Plugin gives you complete control over your post visibility with just a couple of clicks.
Here’s what you need to do.
1. From your main WordPress Dashboard go to Plugins then Add New.
2. Search for “WP Hide Post” using the search bar on the top right.
3. Install and activate the WP Hide Post plugin.
4. Create a new post or select an existing post to edit.
5. On the right-hand side of the editor, you should now see a new box called “Post Visibility”:
Don’t worry if you don’t see this precise box.
Depending on the version of WordPress that you are using, the options box may also appear as Hide Posts as shown below:
1. Whichever box you are working with, the options will be the same, so go ahead and select your preferences from the available options:
Pretty simple isn’t it?
Final thoughts and a quick word to the wise.
While the WP Hide Post Plugin is still being widely used and comes fairly highly recommended, it has actually not been updated in the last 2 years.
It is therefore likely that the creators are no longer supporting the plugin.
This should not make any difference to you in the immediate future.
However, just be aware that the plugin has caused glitches and errors for some users in recent months, which is why many people have chosen to switch to alternatives like the Ultimate Catagory Excluder which are updated frequently:
If you do have any issues and you would like to try the Ultimate Category Excluder, you can follow the steps above and just search for and install that instead.
Then find the box shown above and make your selections from there.
I hope that you have found this tutorial useful and good luck with hiding your content!