DeluxeBlogTips.com 1) has an article on how to do combined searches in both posts and meta data. Basically, it involves two queries via the $wpdb object; one to search the meta table to get a list of post_id
s and the other is a query of posts to get post_id
s. You then merge the arrays and use that to do a query with a WP_Query
using the posts__in
argument.
Using tags may be a bit tricky because 1. tags are meant to group posts together and 2. tags and taxonomies involve 3 different tables.
1) The linked article is not completely right. It should be $keyword = "%".like_escape( $keyword )."%";
.
Related Posts:
- Advanced search form with filters for custom taxonomies and custom fields
- Admin Area Custom Type Search By Meta Fields Without Title & Content
- How do I Paginate Search Results for Custom Post Types?
- Detect meta value changes when post is updated (post_updated)
- get_post_meta not working on publishing
- Search CPT Title AND Meta
- Advanced search form with filters for custom taxonomies and custom fields
- Custom field values deleted when trashing custom post type
- How to get all custom fields of any post type
- Search multiple custom fields by using meta_query
- Search that will look in custom field, post title and post content
- clients list using wordpress
- echo value from ‘select’ field type into page template using cmb2?
- Search Custom Post Type with all meta attached?
- How Do I Use WP_Query to Run This Database Query as Search Result?
- WordPress Admin Panel search posts with custom post meta values along with title
- Backend search; include CPT meta?
- Automatically assign a custom post to a custom taxonomy based on custom field value
- Saving multiple Metabox contents
- How to get source of custom meta image?
- How can I include meta box content when searching?
- Displaying Meta Box Image
- How to add the post ID (or any other post data) to a Contact Form 7 mail?
- Custom search for custom post meta with pre_get_posts interferes with WP search
- Create a random unique 6 digit number as custom field for custom post type
- how to interconnect custom post types?
- Create a post in custom post type using field in registration form after users submit form
- List all images from a single post meta value
- Including Custom Meta with posts_where query
- I did group my search results by post type, but how can i give each of them its own order?
- Meta Key Value in current-user-only loop
- How to implement a Google map store locator
- search also in taxonomy, tags and custom fields
- Filter custom posts using auto populated dropdown selectors
- Posting to a Custom Post Type from front end – user generated content
- Update Post Meta for a logged in user
- A better way to add a meta box to custom post types
- Two Custom Post Types Many to Many Relationship
- Including metaboxes from custom post types in global search — continued
- How do I set all of a particular post meta to a value within the custom post type I’m in?
- Custom fields (wp_post_meta) vs Custom Table for large amount of data
- Homepage’s content is dependent on the custom field values (set automatically), how do I get homepage to update without manually updating page?
- Displaying and searching Custom Posts
- Importing Data from a Non-WordPress database, into WP
- Searching Custom Fields
- How to let users choose where to search for posts?
- Check if post with same meta value exists
- create custom meta box with default value
- ACF in wordpress
- delete_post_meta() for whole CPT / multiple posts?
- How to get specific post meta by title or id
- Add custom attributes to a post
- How to inherit field value from parent post into in child / sub post
- Custom Taxonomy Search result page
- Category Search / Custom Post Type search on my website. Custom Post Types that are “page-like”?
- copy images from custom field to another custom field
- Custom post type in Custom widget – $listItem
- Cannot obtain custom meta information
- How can I output WPAlchemy repeating fields meta values in my page template?
- How to call a post’s metadata in shortcode.php?
- Filtering custom posts by custom fields (ACF) [closed]
- Let users upload image(s) to the post from front end
- delete duplicate meta_value with same post_id
- updating one custom meta field only
- Add a class to post_class if more than one post shares same meta_value_num
- Add a meta field to the list of results for a custom post type
- Empty meta-box returns publishdate if no value is set?
- Filter search posts by post meta?
- Custom fields for post or terms which don’t update on post update
- WordPress CPT Taxonomy Dashboard Search – How to include taxonomy in search?
- Custom Post Type meta data getting deleted on bulk editing taxonomies
- Custom Form / Search with Custom Post Type Data
- Unable to gather Image URL from Custom Post Type’s; Custom Meta Field
- How to keep custom post type related information
- Custom attachment function not working in v5.4.2?
- How can I add a meta[] to my custom post type and search by term with the Rest API?
- Show posts from WP Custom Post Type selected from a field in a metabox
- Creating an archive page or simple template to list all values of a custom field of specific post type listing
- How to convert Post Object Custom Field into Tags
- Custom meta fields not showing up in WP_Response Object via custom endpoint
- Problem with multi checkboxes value in metabox?
- How to Disable option of meta field if that option is selected for any other post in custom post type?
- Custom Function to redirect singular post if specific meta field is empty
- Advanced search form with multiple custom fields
- Stored meta from attachment, video length?
- Search facility with directories
- custom search results – order results differently by post type
- Populate custom post type/custom fields from an external database
- How do I extract the contents of a CPT’s custom field for all posts?
- Custom Field to post_title
- Delete custom post type metadata without deleting the post in admin area
- How can I get the $key / $value pairs of custom fields that were added via 3rd party plugins or themes?
- How to add post reference field to a plugin?
- Search form to find custom meta box generated data
- Function not pulling image or text from custom post type
- Is it good practice to search for custom posts based on custom field values?
- Rich Custom Field for Custom Post type not saving
- I want to split this into two functions
- Allow authors to create article image
- How to display *block number* instead *date value* on WordPress posts?