{"id":2778,"date":"2019-08-03T05:02:49","date_gmt":"2019-08-03T00:02:49","guid":{"rendered":"https:\/\/webplover.com\/hosting\/?p=2778"},"modified":"2022-02-12T14:20:27","modified_gmt":"2022-02-12T09:20:27","slug":"exclude-specific-category-posts-from-wordpress-homepage","status":"publish","type":"post","link":"https:\/\/webplover.com\/hosting\/exclude-specific-category-posts-from-wordpress-homepage\/","title":{"rendered":"How to Exclude Specific Category Posts From Your WordPress Home Page"},"content":{"rendered":"\n<p>If you want to exclude specific category\/categories posts from your WordPress home page, then this article is for you.<\/p>\n\n\n\n<p>By default WordPress doesn&#8217;t allow the user&#8217;s to exclude a category posts from displaying on home page.<\/p>\n\n\n\n<p>So here i will teach you the two methods to exclude a specific category posts from your WordPress home page.<\/p>\n\n\n\n<p><strong>let&#8217;s Start.<\/strong><\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"1-exclude-category-from-home-page-using-plugin\">1: Exclude Category from Home Page Using Plugin<\/h2>\n\n\n\n<p>You can exclude specific category posts from home page by downloading <a href=\"https:\/\/wordpress.org\/plugins\/ultimate-category-excluder\/\">Ultimate Category Excluder<\/a> plugin.<\/p>\n\n\n\n<p>After download, <a href=\"https:\/\/webplover.com\/hosting\/blog\/install-wordpress-plugin\">install &amp; activate the plugin<\/a>. Then go to <strong>Settings \u2192 Category Excluder<\/strong><\/p>\n\n\n\n<p>This plugin will display all the categories of your site.<\/p>\n\n\n\n<figure class=\"wp-block-image is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/webplover.com\/hosting\/wp-content\/uploads\/2018\/12\/exclude-category-from-homepage38387305.png\" alt=\"\" class=\"wp-image-2782\" width=\"677\" height=\"352\"\/><\/figure>\n\n\n\n<p>Now check the categories under <strong>&#8216;Exclude from Front Page&#8217;<\/strong> which you want to exclude from home page.<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\"><p>This plugin also allows you to exclude specific categories from feeds, archives and search result.<\/p><\/blockquote>\n\n\n\n<p>After categories checked, click on the <strong>Update<\/strong> button.<\/p>\n\n\n\n<p>Now the checked categories posts will not shows on your site home page.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"2-exclude-category-from-home-page-using-code\">2: Exclude Category from Home Page Using Code<\/h2>\n\n\n\n<p>In this method you have to add a piece of code to your theme, and you will be able to exclude specific category posts from your home page.<\/p>\n\n\n\n<p>Add the below code to your theme functions.php or site-specific plugin.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>function exclude_category_home( $query ) {\n  if ( $query->is_home ) {\n    $query->set( 'cat', '-26' );\n  }\n  return $query;\n}\nadd_filter( 'pre_get_posts', 'exclude_category_home' );<\/code><\/pre>\n\n\n\n<p>Its important to replace the ID (<strong>-26<\/strong>) with your category ID and don&#8217;t forget the (-) sign with ID.<\/p>\n\n\n\n<p>If you don&#8217;t know how to find category ID, <a href=\"https:\/\/webplover.com\/hosting\/blog\/find-post-page-category-user-id-wordpress\/\">read it<\/a> it will guide you to find category ID.<\/p>\n\n\n\n<p>You can also exclude multiple categories from your home page, for this you have to add comma separate category ID&#8217;s in the above code.<\/p>\n\n\n\n<p><em><strong>For example<\/strong><\/em> : (-55,-6,-12)<\/p>\n\n\n\n<p>{it will exclude categories from your home page, which has <strong>55<\/strong>, <strong>6<\/strong> and <strong>12<\/strong> ID}<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"here-are-a-few-tutorials-for-you-to-read-next\">Here are a few tutorials for you to read next:<\/h3>\n\n\n\n<ul class=\"wp-block-list\"><li><a href=\"https:\/\/webplover.com\/hosting\/blog\/find-post-page-category-user-id-wordpress\/\">How to Find Post, Page, Category, or User ID in WordPress<\/a><\/li><li><a href=\"https:\/\/webplover.com\/hosting\/blog\/add-social-icons-to-wordpress-menu\/\">How To Add Social Media Icons To WordPress Menu<\/a><\/li><li><a href=\"https:\/\/webplover.com\/hosting\/blog\/backup-wordpress-site\/\">How to Backup Your WordPress Site Automatically [With Pictures]<\/a><\/li><li><a href=\"https:\/\/webplover.com\/hosting\/blog\/change-footer-copyrigh-text-of-customizr-theme\/\">How To Change The Footer Copyright Text Of Customizr WordPress Theme<\/a><\/li><li><a href=\"https:\/\/webplover.com\/hosting\/blog\/create-table-in-wordpress\/\">How to create Table in WordPress [With Pictures]<\/a><\/li><li><a href=\"https:\/\/webplover.com\/hosting\/blog\/add-website-to-google\/\">How to Add Website to Google [With Pictures]<\/a><\/li><\/ul>\n\n\n\n<div class=\"g-ytsubscribe\" data-channelid=\"UCArLhGLL14dgeiIKwlu4jYA\" data-layout=\"full\" data-count=\"hidden\">&nbsp;<\/div>\n\n\n\n<p><strong>If you find this tutorial helpful, then please Subscribe to our <\/strong><strong><a href=\"https:\/\/m.youtube.com\/channel\/UCArLhGLL14dgeiIKwlu4jYA\" target=\"_blank\" rel=\"noopener noreferrer\">YouTube Channel<\/a><\/strong><strong> for video tutorials, and share this article on social media.<\/strong><\/p>\n","protected":false},"excerpt":{"rendered":"<p>If you want to exclude specific category\/categories posts from your WordPress home page, then this article is for you. By default WordPress doesn&#8217;t allow the user&#8217;s to exclude a category posts from displaying on home page. So here i will teach you the two methods to exclude a specific category posts from your WordPress home&#8230;<\/p>\n","protected":false},"author":220,"featured_media":4229,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"inline_featured_image":false,"_kadence_starter_templates_imported_post":false,"_kad_post_transparent":"","_kad_post_title":"","_kad_post_layout":"","_kad_post_sidebar_id":"","_kad_post_content_style":"","_kad_post_vertical_padding":"","_kad_post_feature":"","_kad_post_feature_position":"","_kad_post_header":false,"_kad_post_footer":false,"_kad_post_classname":"","footnotes":""},"categories":[228],"tags":[],"class_list":["post-2778","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-wordpress"],"acf":[],"_links":{"self":[{"href":"https:\/\/webplover.com\/hosting\/wp-json\/wp\/v2\/posts\/2778","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/webplover.com\/hosting\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/webplover.com\/hosting\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/webplover.com\/hosting\/wp-json\/wp\/v2\/users\/220"}],"replies":[{"embeddable":true,"href":"https:\/\/webplover.com\/hosting\/wp-json\/wp\/v2\/comments?post=2778"}],"version-history":[{"count":0,"href":"https:\/\/webplover.com\/hosting\/wp-json\/wp\/v2\/posts\/2778\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/webplover.com\/hosting\/wp-json\/wp\/v2\/media\/4229"}],"wp:attachment":[{"href":"https:\/\/webplover.com\/hosting\/wp-json\/wp\/v2\/media?parent=2778"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/webplover.com\/hosting\/wp-json\/wp\/v2\/categories?post=2778"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/webplover.com\/hosting\/wp-json\/wp\/v2\/tags?post=2778"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}