{"id":13096,"date":"2019-07-31T14:32:42","date_gmt":"2019-07-31T14:32:42","guid":{"rendered":"https:\/\/crocoblock.com\/knowledge-base\/?post_type=article&#038;p=13096"},"modified":"2023-07-19T09:53:39","modified_gmt":"2023-07-19T09:53:39","slug":"how-to-set-a-field-key-to-search-in-custom-fields","status":"publish","type":"article","link":"https:\/\/crocoblock.com\/knowledge-base\/jetsearch\/how-to-set-a-field-key-to-search-in-custom-fields\/","title":{"rendered":"How to Configure Field Key to Search in Custom Fields"},"content":{"rendered":"\n<p>With the <em>JetSearch <\/em><a href=\"https:\/\/crocoblock.com\/widgets\/ajax-search\/\" target=\"_blank\" rel=\"noreferrer noopener\"><strong>AJAX Search<\/strong><\/a> block\/widget, you can customize the search results by setting search in specific meta fields. It allows searching only in particular custom fields easily.<\/p>\n\n\n\n<p>We will present an example based on a travel website, where we want to add a search by a particular custom field in tours.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"setting-search-in-custom-fields\">Setting Search in Custom Fields<\/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<p>First, we created the <strong>Tour<\/strong> custom post type and added necessary custom fields, one of which is the <strong>Destination<\/strong>. Then, we attached different tours and filled the custom fields for each.<\/p>\n\n\n\n<img decoding=\"async\" src=\"https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2022\/06\/cpt-meta-field-completed.png\" alt=\"cpt meta field completed\">\n\n\n\n<p>After that, we created a listing and displayed it on the page using the <em>JetEngine <\/em><strong>Listing Grid<\/strong> widget.<\/p>\n<\/div><\/div>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"customizing-the-page-in-elementornbsp\">Customizing the Page in Elementor&nbsp;<\/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<p>We open the <strong>Listing Tours<\/strong> page in <strong>Elementor<\/strong> and drop the <strong>AJAX <\/strong><strong>Search<\/strong> widget in the desired place of the page.<\/p>\n\n\n\n<p>Then, in the widget\u2019s settings block, we uncover the <strong>Search Query<\/strong> tab in the <strong>Content <\/strong>section, specify the <strong>Source<\/strong>: CPT we have built earlier, and fill the <strong>Search in custom fields<\/strong> field with the <strong>_destination<\/strong> meta field, in which the search will be filled in. You should complete this field with the needed meta field key accordingly.<\/p>\n\n\n\n<p>Click the \u201c<strong>Publish\/Update<\/strong>\u201d button to save the results.<\/p>\n\n\n\n<img decoding=\"async\" src=\"https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2022\/06\/search-in-custom-fields-in-elementor.png\" alt=\"search in custom fields in elementor\">\n\n\n\n<p>Now we can view how the search works on the live page. As we have completed the selected meta field with a city name, we can search by typing one of the completed values.<\/p>\n\n\n\n<img decoding=\"async\" src=\"https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2022\/06\/elementor-built-page-search.png\" alt=\"elementor built page searchs\">\n<\/div><\/div>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"adjusting-search-in-gutenberg\">Adjusting Search in Gutenberg<\/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<p>Open the page where you want to place the search in Gutenberg. Place the <strong>AJAX Search <\/strong>block on the edited page.<\/p>\n\n\n\n<p>Now move to the <strong>Search Query <\/strong>tab and specify the adjusted meta field value in the <strong>Search in custom fields <\/strong>bar.&nbsp;<\/p>\n\n\n\n<img decoding=\"async\" src=\"https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2022\/06\/search-in-custom-fields-in-gutenberg.png\" alt=\"search in custom fields in gutenberg\">\n\n\n\n<p>That\u2019s it; after customizing the page, you can press the \u201c<strong>Publish\/Update<\/strong>\u201d button and check the result.<\/p>\n\n\n\n<img decoding=\"async\" src=\"https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2022\/06\/gutenberg-built-page-search.png\" alt=\"gutenberg built page search\">\n<\/div><\/div>\n\n\n\n<p>Finally, you know how to set the search conducted through the meta field values in Gutenberg and Elementor. Try setting the search by field key in custom fields using the <em>JetSearch <\/em>plugin.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Read the detailed information about the process of setting a field key for searching in custom fields using JetSearch functionality.<\/p>\n","protected":false},"author":11,"featured_media":0,"template":"","format":"standard","builder-category":[],"article-category":[430],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.9 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>How to Set up a Field Key for Searching in Custom Fields | Crocobloc<\/title>\n<meta name=\"description\" content=\"Learn how to assign a field key to search in custom fields and widen the AJAX Search widget opportunities available in the Crocoblock subscription.\" \/>\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\/jetsearch\/how-to-set-a-field-key-to-search-in-custom-fields\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to Set up a Field Key for Searching in Custom Fields | Crocobloc\" \/>\n<meta property=\"og:description\" content=\"Learn how to assign a field key to search in custom fields and widen the AJAX Search widget opportunities available in the Crocoblock subscription.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/crocoblock.com\/knowledge-base\/jetsearch\/how-to-set-a-field-key-to-search-in-custom-fields\/\" \/>\n<meta property=\"og:site_name\" content=\"Help Center\" \/>\n<meta property=\"article:modified_time\" content=\"2023-07-19T09:53:39+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2022\/06\/cpt-meta-field-completed.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=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/crocoblock.com\/knowledge-base\/jetsearch\/how-to-set-a-field-key-to-search-in-custom-fields\/\",\"url\":\"https:\/\/crocoblock.com\/knowledge-base\/jetsearch\/how-to-set-a-field-key-to-search-in-custom-fields\/\",\"name\":\"How to Set up a Field Key for Searching in Custom Fields | Crocobloc\",\"isPartOf\":{\"@id\":\"https:\/\/crocoblock.com\/knowledge-base\/#website\"},\"datePublished\":\"2019-07-31T14:32:42+00:00\",\"dateModified\":\"2023-07-19T09:53:39+00:00\",\"description\":\"Learn how to assign a field key to search in custom fields and widen the AJAX Search widget opportunities available in the Crocoblock subscription.\",\"breadcrumb\":{\"@id\":\"https:\/\/crocoblock.com\/knowledge-base\/jetsearch\/how-to-set-a-field-key-to-search-in-custom-fields\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/crocoblock.com\/knowledge-base\/jetsearch\/how-to-set-a-field-key-to-search-in-custom-fields\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/crocoblock.com\/knowledge-base\/jetsearch\/how-to-set-a-field-key-to-search-in-custom-fields\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/crocoblock.com\/knowledge-base\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Articles\",\"item\":\"https:\/\/crocoblock.com\/knowledge-base\/articles\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"How to Configure Field Key to Search in Custom Fields\"}]},{\"@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 Set up a Field Key for Searching in Custom Fields | Crocobloc","description":"Learn how to assign a field key to search in custom fields and widen the AJAX Search widget opportunities available in the Crocoblock subscription.","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\/jetsearch\/how-to-set-a-field-key-to-search-in-custom-fields\/","og_locale":"en_US","og_type":"article","og_title":"How to Set up a Field Key for Searching in Custom Fields | Crocobloc","og_description":"Learn how to assign a field key to search in custom fields and widen the AJAX Search widget opportunities available in the Crocoblock subscription.","og_url":"https:\/\/crocoblock.com\/knowledge-base\/jetsearch\/how-to-set-a-field-key-to-search-in-custom-fields\/","og_site_name":"Help Center","article_modified_time":"2023-07-19T09:53:39+00:00","og_image":[{"url":"https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2022\/06\/cpt-meta-field-completed.png"}],"twitter_card":"summary_large_image","twitter_misc":{"Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/crocoblock.com\/knowledge-base\/jetsearch\/how-to-set-a-field-key-to-search-in-custom-fields\/","url":"https:\/\/crocoblock.com\/knowledge-base\/jetsearch\/how-to-set-a-field-key-to-search-in-custom-fields\/","name":"How to Set up a Field Key for Searching in Custom Fields | Crocobloc","isPartOf":{"@id":"https:\/\/crocoblock.com\/knowledge-base\/#website"},"datePublished":"2019-07-31T14:32:42+00:00","dateModified":"2023-07-19T09:53:39+00:00","description":"Learn how to assign a field key to search in custom fields and widen the AJAX Search widget opportunities available in the Crocoblock subscription.","breadcrumb":{"@id":"https:\/\/crocoblock.com\/knowledge-base\/jetsearch\/how-to-set-a-field-key-to-search-in-custom-fields\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/crocoblock.com\/knowledge-base\/jetsearch\/how-to-set-a-field-key-to-search-in-custom-fields\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/crocoblock.com\/knowledge-base\/jetsearch\/how-to-set-a-field-key-to-search-in-custom-fields\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/crocoblock.com\/knowledge-base\/"},{"@type":"ListItem","position":2,"name":"Articles","item":"https:\/\/crocoblock.com\/knowledge-base\/articles\/"},{"@type":"ListItem","position":3,"name":"How to Configure Field Key to Search in Custom Fields"}]},{"@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\/article\/13096"}],"collection":[{"href":"https:\/\/crocoblock.com\/knowledge-base\/wp-json\/wp\/v2\/article"}],"about":[{"href":"https:\/\/crocoblock.com\/knowledge-base\/wp-json\/wp\/v2\/types\/article"}],"author":[{"embeddable":true,"href":"https:\/\/crocoblock.com\/knowledge-base\/wp-json\/wp\/v2\/users\/11"}],"wp:attachment":[{"href":"https:\/\/crocoblock.com\/knowledge-base\/wp-json\/wp\/v2\/media?parent=13096"}],"wp:term":[{"taxonomy":"builder-category","embeddable":true,"href":"https:\/\/crocoblock.com\/knowledge-base\/wp-json\/wp\/v2\/builder-category?post=13096"},{"taxonomy":"article-category","embeddable":true,"href":"https:\/\/crocoblock.com\/knowledge-base\/wp-json\/wp\/v2\/article-category?post=13096"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}