Buy me a coffee

Exclude a category of posts from showing on the main blog page

You can follow these steps to exclude a category of posts from showing on the main blog page.

#0. Suppose you have a blog category: Bike, you want to hide all posts belong this category on main blog page.

#1. Edit all posts belong the category: Bike > Settings

Exclude A Category Of Posts From Showing On The Main Blog Page 01 Min

#2. Edit Excerpt > Enter text: bike

Exclude A Category Of Posts From Showing On The Main Blog Page 02 Min

Highlight it and add URL: #bike

Exclude A Category Of Posts From Showing On The Main Blog Page 03 Min

#3. Find Main Blog Page ID. Use this tool.

In my example, it is:

  • #collection-6677756d03a4f15ba27ce9d8

Exclude A Category Of Posts From Showing On The Main Blog Page 04 Min

#4. Use this code to Custom CSS box

#collection-6677756d03a4f15ba27ce9d8 {
    article.blog-item [href="#bike"] {
    display: none;
}
article.blog-item:has([href="#bike"]) {
    display: none;
}}

Exclude A Category Of Posts From Showing On The Main Blog Page 05 Min