Contents
How to hide or remove categories from a homepage?
When displaying your latest posts on the homepage, you might want to exclude some categories from displaying on this page. There are many reasons why you would want to do this. You might want to keep your homepage for only news posts and relegate the rest of the posts to other sections accessed through the menu. November 14, 2020
Is it possible to hide a category in WordPress?
Thus, you have to hide the category. Unfortunately, WordPress won’t let you hide categories from the homepage or archives and it will keep showing the category and its posts on the homepage. Hiding a category in WordPress is a pretty simple task.
How can I exclude posts from my home page?
The easiest way to exclude posts from the homepage is of course using a plugin (if your homepage is setup to display latest posts). One of the currently best rated plugins for this is called WP Exclude From Homepage which allows you to exclude categories, tags, posts of even pages from the homepage without breaking pagination.
How to hide posts on your WordPress home page?
Remember to back up your site before modifying theme files like this. Basically, you create a dedicated category for the posts you want to hide, jot down the category ID, then paste the following bit of code at the end of the file right before “?>” and replace the “xx” with the category ID:
Can you exclude a category from your WordPress homepage?
By default, WordPress does not allow you to hide posts in specific categories from homepage or archives. This leaves you with unwanted posts appearing on your homepage. That being said, let’s see how you can easily exclude a specific category from your WordPress homepage.
How to add categories to your WordPress home page?
We can use the WP_Query function itself to customise what posts are called and subsequently displayed on our home page, blox index or archives (e.g. category, date and tag archives). Alternatively, we can use the function query_posts to alter the main loop.
Why do I need to hide my Homepage in WordPress?
There are many reasons why you would want to do this. You might want to keep your homepage for only news posts and relegate the rest of the posts to other sections accessed through the menu. In any case, what we will need to modify is the WordPress loop.