{"id":121530,"date":"2023-06-09T21:29:45","date_gmt":"2023-06-09T20:29:45","guid":{"rendered":"https:\/\/wpsimplefix.com\/?p=121530"},"modified":"2026-09-24T17:40:58","modified_gmt":"2026-09-24T17:40:58","slug":"how-to-exclude-pages-from-search-results-in-wordpress-or-elementor","status":"publish","type":"post","link":"https:\/\/chkserv.com\/blog\/how-to-exclude-pages-from-search-results-in-wordpress-or-elementor\/","title":{"rendered":"How to exclude pages from search results in Elementor?"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">While <a href=\"https:\/\/chkserv.com\/blog\/blog\/category\/elementor\/\" target=\"_blank\" rel=\"noopener\">Elementor<\/a> has a lot of features, there are instances when you wish to remove specific pages from search results. Elementor has become one of the most popular page builders, providing users with a robust and versatile tool for designing their websites.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">This blog post will walk you through the process of properly concealing pages from search results, whether you have landing pages, thank you pages, or incomplete drafts that you don&#8217;t want people to stumble across.<\/p>\n\n\n\n<div style=\"height:30px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h2 class=\"wp-block-heading\">Adding The Code<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Place the following code at the bottom of your themes <strong>functions.php<\/strong> file;<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\/wp-content\/themes\/<strong>your-active-theme<\/strong>\/functions.php<\/li>\n\n\n\n<li>Save the file. Then go refresh your site and it should work.<\/li>\n<\/ul>\n\n\n\n<pre class=\"wp-block-preformatted has-white-color has-black-background-color has-text-color has-background has-link-color wp-elements-1\"><code readonly=\"true\"><span style=\"font-size: inherit;\">## Exclude Pages From Search Results<\/span><\/code><br><code readonly=\"true\">if (!is_admin()) {<br>function wpsf_search_filter($query) {<br>if ($query->is_search) {<br>$query->set('post_type', array( 'post','product'));<br>}<br>return $query;<br>}<br>add_filter('pre_get_posts','wpsf_search_filter');<br>}<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><strong><em>Warning<\/em><\/strong><br> If your theme is updated, you may need to re-enter the code into that file. So bookmark this page.<\/p>\n\n\n\n<div style=\"height:40px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h2 class=\"wp-block-heading\">Conclusion<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Hiding pages from <a href=\"https:\/\/be.elementor.com\/visit\/?bta=207785&amp;nci=5383\" target=\"_blank\" rel=\"nofollow noopener\">Elementor<\/a> search results is essential for keeping your website clean and user-friendly. You can simply regulate the visibility of your pages and guarantee that only relevant information shows in your website search results by following the procedure suggested in this tutorial.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>While Elementor has a lot of features, there are instances when you wish to remove specific pages from search results. Elementor has become one of the most popular page builders, providing users with a robust and versatile tool for designing their websites. This blog post will walk you through the process of properly concealing pages [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":116313,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[15],"tags":[14,154,155,142,156,157],"class_list":["post-121530","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-elementor","tag-elementor","tag-exclude","tag-hide","tag-pages","tag-results","tag-search"],"_links":{"self":[{"href":"https:\/\/chkserv.com\/blog\/wp-json\/wp\/v2\/posts\/121530","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/chkserv.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/chkserv.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/chkserv.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/chkserv.com\/blog\/wp-json\/wp\/v2\/comments?post=121530"}],"version-history":[{"count":4,"href":"https:\/\/chkserv.com\/blog\/wp-json\/wp\/v2\/posts\/121530\/revisions"}],"predecessor-version":[{"id":136669,"href":"https:\/\/chkserv.com\/blog\/wp-json\/wp\/v2\/posts\/121530\/revisions\/136669"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/chkserv.com\/blog\/wp-json\/wp\/v2\/media\/116313"}],"wp:attachment":[{"href":"https:\/\/chkserv.com\/blog\/wp-json\/wp\/v2\/media?parent=121530"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/chkserv.com\/blog\/wp-json\/wp\/v2\/categories?post=121530"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/chkserv.com\/blog\/wp-json\/wp\/v2\/tags?post=121530"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}