I can think of two options:
- Multiple
WP_Queries
, each for normal search, taxonomies and meta. And merge the results you get from each.
OR
- A
WPDB
query, withjoin
between_post
,_postmeta
,_terms
(and all tables related toterms
).
Although I will prefer 1st method, it’s your choice what you are comfortable with and performance you are expecting, in term of resource ans speed.
Edit:
$q1 = get_posts(array(
'post_status' => 'publish',
'posts_per_page' => '-1',
's' => get_search_query()
)
);
$q2 = get_posts(array(
'post_status' => 'publish',
'posts_per_page' => '-1',
'tax_query' => array(
//your query
)
)
);
$merged = array_merge($q1, $q2);
Not exact query but just to give you an idea. Please check for any syntax errors as I haven’t tested it.
Related Posts:
- How to search for categories and/or tags?
- Sticky posts on home page, search, tag and archives without plugin
- Search by word, category, tag, author
- Help with multiple dropdown tags search
- Search Posts / Pages with multiple options?
- Site search needs to find posts for category topic AND Tag or keyword thats not in the post
- Show Posts via cat+cat in URL that are in both Categories doesn’t work
- Automatically adding tags and categories into Post Excerpt for searching
- Return all Tags and Categories in Separate List
- 404 error when i try to search by category or by tag
- Query posts that have all the specified tags
- Is There a Difference Between Taxonomies and Categories?
- What is the difference between a “tag” and a “category”?
- Can’t custom taxonomies have same terms (slugs) as categories?
- WordPress Multiple Category Search
- How do the ‘tag’ and ‘category’ (default) taxonomies do ‘save_post’ action?
- get all tags from category
- 404 Error On Category and Tags Pages
- Checklist of selected categories
- Exclude categories from search query
- Sort posts by tags in category pages
- How to get the url to tag & category base set by the user?
- Filter categories using tags
- Create product category and keyword search form in woocommerce? [closed]
- Category and tag with same name
- In the tag archive – display count of posts for each category they belong to
- Is it possible to disable certain user roles from creating tags?
- Exclude most recent posts from specific category in wp_query()
- Custom Query to search through categories
- Root level category, tag, author and archive pages to work
- Deleting All tags except categories Wp database
- How do I get the total number of categories in a list of search results?
- Category Search functionality on category metabox (wordpress admin)
- Filtering search results
- Remove Categories and Tags from Admin Dashboard
- Remove Archive Headline and Archive Intro Text fields on category and tag archive pages in WordPress Admin with Genesis framework
- Get tags specific category
- Category vs Tag vs Table
- Hide tag and category boxes from the post editor
- Retrieve all posts within tag OR category?
- How to find the number of Tags a post has?
- How to not treat categories as tags in feeds
- Categories: A Greenhorn Question on Strategy (Not Code)
- How to customize tag and category post listings to show introductory content?
- Multiple Category Search
- Warning: sizeof (): Parameter must be an array or an object that implements Countable, On products pages
- Making a tourism information website [closed]
- How get permalink for the current category or tag?
- Display tags from specific category in select fields
- Offline WordPress Application
- Changing permalink from /postname/ to category/postname/
- Find out which user created a category or tag?
- How to make 2 tag feeds show up on 1 page?
- WordPress search only showing a few posts
- Different templates for different category tags
- Search in custom post type AND in pages with category
- Pagination is not working properly in Product Category/Tag pages
- Get link which associated with a specific category and tag
- How do I toggle pagination on/off in search results and category listings via a link?
- menu using category and tags
- Is there a reason I cannot get the current category in a loop?
- How to Remove a Title from All Category and Tags Page?
- How can I display tags as categories?
- How to get an array with all categories and corresponding names?
- Echo text using is_tag
- Group search results by category
- Woocommerce search form with category select
- Using if statement in index.php instead of creating separate template files
- Tags Instead of Category
- Use blog as base for tags and categories
- How to store category and tags separatly on wordpress?
- post_class remove tag- or category- from slug
- Editing Loop So It Targets Specific Tags?
- Pretty URLs with Categories and Tags
- What is the best way to add an advanced / intermediate / beginner tag to a post
- Display all categories but only if they have posts in them that have a specific tag assigned
- display specific category when website loads
- Help to display the current categories and tags of a post
- WordPress Default Category and Custom Taxonomy Selected Attribute not Working After Searched in wp_dropdown_categories Array
- How to add tags under categories
- Add Post Categories in Post Tags Field Programmatically
- How to show entries related to main category
- Automatically create tags and merge with categories
- How to assign Categories and tags inside the TinyMCE Editor for each Image?
- Search Replace Database ONLY for posts of certain category?
- Re-coding category-template.php to go to custom URL
- custom browse by
- Limit Category/Tag Dropdown To blog_id in Multisite Install With Global Categories/Tags
- Tag Menu items based on their categories
- How to add an “All” category to the tag cloud?
- Hide category name using mod_rewrite
- A search box for all sites – Multisite
- Unable to get all tags from specific categories
- htaccess redirect for all categories converted to tags now showing 404
- How to create a category or tag available exclusively to the admins and not to the users?
- altering theme – content generated by PAGES not PORTFOLIO
- Search tag within category
- Search functionality with multiple categories
- Display category tree of a post in search results
- Remove “All categories” from searchbar dropdown