{"id":30129,"date":"2022-11-04T10:14:15","date_gmt":"2022-11-04T10:14:15","guid":{"rendered":"https:\/\/crocoblock.com\/knowledge-base\/tips-and-tricks\/including-excluding-out-of-stock-products-in-search\/"},"modified":"2023-04-03T14:08:55","modified_gmt":"2023-04-03T14:08:55","slug":"including-excluding-out-of-stock-products-in-search","status":"publish","type":"tips-and-tricks","link":"https:\/\/crocoblock.com\/knowledge-base\/tips-and-tricks\/including-excluding-out-of-stock-products-in-search\/","title":{"rendered":"Including\/Excluding Out-of-Stock Products in Search"},"content":{"rendered":"\n<p>If you wish to exclude some products and not show them in the search results, configure your WordPress search results with the AJAX Search widget or Block according to the steps below.<\/p>\n\n\n\n<p>The search will be performed based on the WooCommerce product\u2019s field <em>Stock<\/em>, which takes two possible values: <em>In Stock<\/em> and <em>Out-of-Stock<\/em>.<\/p>\n\n\n\n<img decoding=\"async\" src=\"https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2023\/04\/1_products-2x.png\" alt=\"custom product posts to include or exclude from search\">\n\n\n\n<h2 class=\"wp-block-heading\" id=\"includeexclude-outofstock-products-in-search-in-elementor\"><strong>Include\/Exclude Out-of-Stock Products in Search in Elementor<\/strong><\/h2>\n\n\n\n<div class=\"wp-block-group is-layout-constrained wp-block-group-is-layout-constrained\"><div class=\"wp-block-group__inner-container\">\n<h3 class=\"wp-block-heading\" id=\"place-the-ajax-search-widget\"><strong>Place the Ajax Search widget<\/strong><\/h3>\n\n\n\n<p class=\"offset\">Open a page you want to apply the <strong>Ajax Search<\/strong> widget. Place this widget on the page.<\/p>\n\n\n\n<img decoding=\"async\" src=\"https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2023\/04\/2_page_search-2x.png\" alt=\"elementor page with ajax search widget\">\n\n\n\n<h3 class=\"wp-block-heading\" id=\"select-the-source-for-the-search\"><strong>Select the source for the search<\/strong><\/h3>\n\n\n\n<p class=\"offset\">Navigate to the <strong>Search Query<\/strong> settings of the <strong>Ajax Search <\/strong>widget.&nbsp;<\/p>\n\n\n\n<p class=\"offset\">Unscroll the <strong>Search Query<\/strong> section and specify the source of the search. To do this, proceed to the <strong>Search<\/strong> drop-down menu and choose the type of content (i.e., posts, pages, CPT, etc.).<\/p>\n\n\n\n<img decoding=\"async\" src=\"https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2023\/04\/3_all_res-2x.png\" alt=\"selecting the source for search in elementor\">\n\n\n\n<p class=\"offset\">This configuration allows searching for all products without excluding some of them.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"exclude-the-specific-products\"><strong>Exclude the specific products<\/strong><\/h3>\n\n\n\n<p class=\"offset\">To exclude products <em>Out-of-Stock<\/em> from the search results, navigate to the <strong>Exclude<\/strong> tab. Type some symbols of the necessary <strong>Terms<\/strong> to find them and choose from the drop-down menu: &#8220;Product visibility: outofstock&#8221;.<\/p>\n\n\n\n<img decoding=\"async\" src=\"https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2023\/04\/4_elem_excl-2x.png\" alt=\"search query section settings for search\">\n\n\n\n<p class=\"offset\">This setting limits the search area; therefore, the search results do not have other products.&nbsp;<\/p>\n\n\n\n<p>Read about <a href=\"https:\/\/crocoblock.com\/knowledge-base\/articles\/jetsearch-how-to-exclude-certain-terms-and-posts-in-ajax-search-widget-search-query\/\" target=\"_blank\" rel=\"noreferrer noopener\">How to Exclude Certain Terms and Posts in AJAX Search Query<\/a> in Elementor and Gutenberg.<\/p>\n<\/div><\/div>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"includeexclude-outofstock-products-in-search-in-gutenberg\"><strong>Include\/Exclude Out-of-Stock Products in Search in Gutenberg<\/strong><\/h2>\n\n\n\n<div class=\"wp-block-group is-layout-constrained wp-block-group-is-layout-constrained\"><div class=\"wp-block-group__inner-container\">\n<h3 class=\"wp-block-heading\" id=\"place-the-ajax-search-block\"><strong>Place the Ajax Search block<\/strong><\/h3>\n\n\n\n<p class=\"offset\">Open a page you want to apply the <strong>Ajax Search<\/strong> block and place this block on the page.<\/p>\n\n\n\n<img decoding=\"async\" src=\"https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2023\/04\/5_gut_page-2x.png\" alt=\"gutenberg page with ajax search block\">\n\n\n\n<h3 class=\"wp-block-heading\" id=\"select-the-source-for-the-search\"><strong>Select the source for the search<\/strong><\/h3>\n\n\n\n<p class=\"offset\">To specify the search area of the website\u2019s content, navigate to the <strong>Search Query<\/strong> section of this block and select the source of the search (i.e., <em>Products<\/em>). Choose the taxonomy you need from the drop-down menu.<\/p>\n\n\n\n<img decoding=\"async\" src=\"https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2023\/04\/6_gut_query-2x.png\" alt=\"selecting the source for search in gutenberg\">\n\n\n\n<p class=\"offset\">The search results show all products without excluding them.<\/p>\n\n\n\n<img decoding=\"async\" src=\"https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2023\/04\/7_gut_all_res-2x.png\" alt=\"search results without excluding in gutenberg\">\n\n\n\n<h3 class=\"wp-block-heading\" id=\"exclude-specific-products\"><strong>Exclude specific products<\/strong><\/h3>\n\n\n\n<p class=\"offset\">To exclude some content from the search results, navigate to the <strong>Ajax Search<\/strong> block\u2019s <strong>Search Query Includes\/Excludes<\/strong> section and choose the appropriate settings from the drop-down menus.<\/p>\n\n\n\n<img decoding=\"async\" src=\"https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2023\/04\/8_include_exclude-1x.png\" alt=\"search query include and exclude section\">\n\n\n\n<p class=\"offset\">It allows us to show only the information referring to these settings and exclude the products out of stock.<\/p>\n\n\n\n<img decoding=\"async\" src=\"https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2023\/04\/9_gut_exclude-2x.png\" alt=\"search results with excluded products\">\n<\/div><\/div>\n\n\n\n<p class=\"offset\">Managing these settings allows including or excluding specific products from the search results.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Learn about how to include or exclude WooCommerce products that are out of stock with the help of the JetSearch plugin.<\/p>\n","protected":false},"author":1,"featured_media":0,"template":"","format":"standard","tipstricks-tags":[364],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.9 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>How to Include\/Exclude Out of Stock Products from Search Results | Crocoblock<\/title>\n<meta name=\"description\" content=\"Learn how to include\/exclude out-of-stock products in the search. Manage your WordPress search results with the AJAX Search widget or Block in Elementor and Gutenberg.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/crocoblock.com\/knowledge-base\/tips-and-tricks\/including-excluding-out-of-stock-products-in-search\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to Include\/Exclude Out of Stock Products from Search Results | Crocoblock\" \/>\n<meta property=\"og:description\" content=\"Learn how to include\/exclude out-of-stock products in the search. Manage your WordPress search results with the AJAX Search widget or Block in Elementor and Gutenberg.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/crocoblock.com\/knowledge-base\/tips-and-tricks\/including-excluding-out-of-stock-products-in-search\/\" \/>\n<meta property=\"og:site_name\" content=\"Help Center\" \/>\n<meta property=\"article:modified_time\" content=\"2023-04-03T14:08:55+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2023\/04\/1_products-2x.png\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"4 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/crocoblock.com\/knowledge-base\/tips-and-tricks\/including-excluding-out-of-stock-products-in-search\/\",\"url\":\"https:\/\/crocoblock.com\/knowledge-base\/tips-and-tricks\/including-excluding-out-of-stock-products-in-search\/\",\"name\":\"How to Include\/Exclude Out of Stock Products from Search Results | Crocoblock\",\"isPartOf\":{\"@id\":\"https:\/\/crocoblock.com\/knowledge-base\/#website\"},\"datePublished\":\"2022-11-04T10:14:15+00:00\",\"dateModified\":\"2023-04-03T14:08:55+00:00\",\"description\":\"Learn how to include\/exclude out-of-stock products in the search. Manage your WordPress search results with the AJAX Search widget or Block in Elementor and Gutenberg.\",\"breadcrumb\":{\"@id\":\"https:\/\/crocoblock.com\/knowledge-base\/tips-and-tricks\/including-excluding-out-of-stock-products-in-search\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/crocoblock.com\/knowledge-base\/tips-and-tricks\/including-excluding-out-of-stock-products-in-search\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/crocoblock.com\/knowledge-base\/tips-and-tricks\/including-excluding-out-of-stock-products-in-search\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/crocoblock.com\/knowledge-base\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Tips & tricks\",\"item\":\"https:\/\/crocoblock.com\/knowledge-base\/tips-and-tricks\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Including\/Excluding Out-of-Stock Products in Search\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/crocoblock.com\/knowledge-base\/#website\",\"url\":\"https:\/\/crocoblock.com\/knowledge-base\/\",\"name\":\"Help Center\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\/\/crocoblock.com\/knowledge-base\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/crocoblock.com\/knowledge-base\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/crocoblock.com\/knowledge-base\/#organization\",\"name\":\"Help Center\",\"url\":\"https:\/\/crocoblock.com\/knowledge-base\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/crocoblock.com\/knowledge-base\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2025\/04\/invert-crocoblock-logo.svg\",\"contentUrl\":\"https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2025\/04\/invert-crocoblock-logo.svg\",\"caption\":\"Help Center\"},\"image\":{\"@id\":\"https:\/\/crocoblock.com\/knowledge-base\/#\/schema\/logo\/image\/\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to Include\/Exclude Out of Stock Products from Search Results | Crocoblock","description":"Learn how to include\/exclude out-of-stock products in the search. Manage your WordPress search results with the AJAX Search widget or Block in Elementor and Gutenberg.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/crocoblock.com\/knowledge-base\/tips-and-tricks\/including-excluding-out-of-stock-products-in-search\/","og_locale":"en_US","og_type":"article","og_title":"How to Include\/Exclude Out of Stock Products from Search Results | Crocoblock","og_description":"Learn how to include\/exclude out-of-stock products in the search. Manage your WordPress search results with the AJAX Search widget or Block in Elementor and Gutenberg.","og_url":"https:\/\/crocoblock.com\/knowledge-base\/tips-and-tricks\/including-excluding-out-of-stock-products-in-search\/","og_site_name":"Help Center","article_modified_time":"2023-04-03T14:08:55+00:00","og_image":[{"url":"https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2023\/04\/1_products-2x.png"}],"twitter_card":"summary_large_image","twitter_misc":{"Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/crocoblock.com\/knowledge-base\/tips-and-tricks\/including-excluding-out-of-stock-products-in-search\/","url":"https:\/\/crocoblock.com\/knowledge-base\/tips-and-tricks\/including-excluding-out-of-stock-products-in-search\/","name":"How to Include\/Exclude Out of Stock Products from Search Results | Crocoblock","isPartOf":{"@id":"https:\/\/crocoblock.com\/knowledge-base\/#website"},"datePublished":"2022-11-04T10:14:15+00:00","dateModified":"2023-04-03T14:08:55+00:00","description":"Learn how to include\/exclude out-of-stock products in the search. Manage your WordPress search results with the AJAX Search widget or Block in Elementor and Gutenberg.","breadcrumb":{"@id":"https:\/\/crocoblock.com\/knowledge-base\/tips-and-tricks\/including-excluding-out-of-stock-products-in-search\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/crocoblock.com\/knowledge-base\/tips-and-tricks\/including-excluding-out-of-stock-products-in-search\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/crocoblock.com\/knowledge-base\/tips-and-tricks\/including-excluding-out-of-stock-products-in-search\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/crocoblock.com\/knowledge-base\/"},{"@type":"ListItem","position":2,"name":"Tips & tricks","item":"https:\/\/crocoblock.com\/knowledge-base\/tips-and-tricks\/"},{"@type":"ListItem","position":3,"name":"Including\/Excluding Out-of-Stock Products in Search"}]},{"@type":"WebSite","@id":"https:\/\/crocoblock.com\/knowledge-base\/#website","url":"https:\/\/crocoblock.com\/knowledge-base\/","name":"Help Center","description":"","publisher":{"@id":"https:\/\/crocoblock.com\/knowledge-base\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/crocoblock.com\/knowledge-base\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/crocoblock.com\/knowledge-base\/#organization","name":"Help Center","url":"https:\/\/crocoblock.com\/knowledge-base\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/crocoblock.com\/knowledge-base\/#\/schema\/logo\/image\/","url":"https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2025\/04\/invert-crocoblock-logo.svg","contentUrl":"https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2025\/04\/invert-crocoblock-logo.svg","caption":"Help Center"},"image":{"@id":"https:\/\/crocoblock.com\/knowledge-base\/#\/schema\/logo\/image\/"}}]}},"_links":{"self":[{"href":"https:\/\/crocoblock.com\/knowledge-base\/wp-json\/wp\/v2\/tips-and-tricks\/30129"}],"collection":[{"href":"https:\/\/crocoblock.com\/knowledge-base\/wp-json\/wp\/v2\/tips-and-tricks"}],"about":[{"href":"https:\/\/crocoblock.com\/knowledge-base\/wp-json\/wp\/v2\/types\/tips-and-tricks"}],"author":[{"embeddable":true,"href":"https:\/\/crocoblock.com\/knowledge-base\/wp-json\/wp\/v2\/users\/1"}],"wp:attachment":[{"href":"https:\/\/crocoblock.com\/knowledge-base\/wp-json\/wp\/v2\/media?parent=30129"}],"wp:term":[{"taxonomy":"tipstricks-tags","embeddable":true,"href":"https:\/\/crocoblock.com\/knowledge-base\/wp-json\/wp\/v2\/tipstricks-tags?post=30129"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}