The default WordPress search query only works on post_title and post_content fields from the wp_posts
table, not including meta stored on the wp_postmeta
table.
It really depends on what type of search you want to perform how you could solve this, for instance, “full text”-type search, require a match on a given post meta, custom ranking, etc.
I think the current good practice, and a simple solution, would be to add those kind of meta data using blocks (which would save their data on the post_content field), and also saving them as meta data (as “source of truth” or more advanced querying).
For showing the meta data, you can use get_post_meta( $post->ID, 'meta_key', true )
or echo $post->my_custom_meta_key
(WordPress would automatically show the value from the given meta key).
Related Posts:
- Simple way to search custom-post types only
- WordPress Search documentation: how to improve search query using taxonomy terms, custom meta fields?
- Building an Advanced Search (text, tags, category, custom fields) – Getting the wrong SQL query
- Limit search field to just search a custom post type with custom fields
- search results to show individual ACF fields from inside custom posts
- Advanced search form with multiple custom fields
- How to make a WP_Query search with custom post types?
- importing third party json feed as custom post type [closed]
- Search that will look in custom field, post title and post content
- Returning search results by relevance, including Custom Post Types
- How to replicate some of Drupal Views functionality in WordPress?
- Seperating Custom Post Search Results
- Hiding Custom Post Type from Google?
- Exclude from search all custom posts which are NOT in a taxonomy term
- WP Rest API Querying Custom Posts by ACF fields
- Meta Query “IN” doesn’t work with ACF checkbox filter
- How Do I Use WP_Query to Run This Database Query as Search Result?
- No results searching custom post type in admin panel
- How to set custom post type as post title to avoid ‘Auto Draft’
- Query current and future events, ordered by begin date
- Change message given when deleting post from custom post type
- Linking three taxonomies with ACF
- error in Advanced Search Form for Custom Post Types in WordPress array_key_exists() expects parameter 2to be array, string given
- Search Custom Post Type Custom Fields
- Query Custom Post Types by date (custom field) range
- Keyword search limited to specific post type filtered by multiple custom taxonomies?
- Remove duplicated values from a loop
- How to retrieve category NAME instead of ID in a function with a taxonomy custom field?
- “add_post_type_support” with Custom Post Type & ACF
- Custom Post type and Custom Field WP_Query
- Display multiple custom post types and sort them chronological by one of their fields
- WooCommerce product search titles only
- custom post type Search returns No Results in admin panel
- Search Custom Post Type & Taxonomies
- filter custom post type by meta key in dashboard
- How to add a post slug to a url?
- ACF Field on CPT Slug
- Custom Post Type + ACF and performance [closed]
- Meta Query Not Returning Output Despite Having Matching Values
- Pretty URL for custom search for custom post type
- Add post location with mile radius allowing search
- The loop seems stuck to a single (now deleted) post
- Multiple Frontend Filters Using Advanced Custom Fields
- Displaying custom field according to date
- filter search custom field query
- Include custom taxonomy term in search
- Sort a custom post with ACF: Date Picker & Display Featured!
- Postname on unique permalink structure appends “-2” for a custom post type. How can I get this to stop happening?
- Custome fields not displayed
- Prevent A Specific Custom Post Type Showing In WP Search Results Page
- Create short URL with auto 301 redirect
- Why is wp api returning old acf values?
- Hide custom post type from search based on custom taxonomy
- get custom post type value in header.php [closed]
- How do I get_the_postID() for a custom post that uses ACF repeater field?
- Pagination on search results page
- Group by custom field value (start and end times)
- Custom post types, disable fields
- Best way to create a search for custom post type by custom field values
- Multi Parameter search with custom post type category and tag
- wp-includes does not contain a feed template
- Excerpt length: get first paragraph
- How to have multiple search result pages in wordpress with taxonomy terms listed
- count & sum the value of custom field of the author post in dynamic posts
- Orderby custom fields is not working
- Custom post ID & display information related to this ID
- Display a Custom Post Type with Advanced Custom Fields on Homepage
- Filter result of Custom Post Type using meta_query with ACF
- Same custom post type with different ACF
- Custom sorting in post columns by ACF Pro Select Field
- Subpages URLs for Custom Post Type
- Custom post type not pulling CSS
- Button link display in shortcodes using custom field in ACF
- Custom Post type doesn’t appear in search results
- How to show link to product in custom fields?
- In the admin, how can you list thumbnails instead of titles for a custom post type?
- Looping through image object using ACF and CPT UI [SOLVED]
- WordPress page not showing up – replaced with last 10 posts?
- Custom permalink rewrite rules – how do I fix this?
- Best way to have one product in both rental and sale parent category
- How do I display specific custom posts, and how do I edit a post’s singular page?
- Showing custom post user wise with different color in wordpress
- Submit and edit font end custom post type
- How to make a custom search template for custom taxonomy?
- Filter Content on all Post Types
- WP_Query with custom post type search showing all results every time
- Advanced Custom Fields – Add Field to Specific Page [closed]
- Search form to find custom meta box generated data
- Modifying and Displaying URL’s in a Post Template using parse_url
- Multiple search template with separate stylesheets
- Customising wordpress search and using $_GET[“s”]
- WordPress search results
- WooCommerce – Complete Order when an action occurs
- WordPress Loop trouble with ACF [closed]
- Drop Down Filter with CPT as Options for Search Form
- Searching Custom Posts content with JQuery
- WordPress search results grouped by post type
- Two custom post type relations
- Group search results by post type, but having a unique heading for each section?
- selecting custom post types and taxonomies for hub page listing blocks