To search, use the s
option as described in the WP_Query
documentation
https://codex.wordpress.org/Class_Reference/WP_Query#Search_Parameter
Search Parameter
Show posts based on a keyword search.
s (string) - Search keyword.
Show Posts based on a keyword search
Display posts that match the search term
"keyword"
:$query = new WP_Query( array( 's' => 'keyword' ) );
Prepending a term with a hyphen will exclude posts matching that term. Eg,
'pillow -sofa'
will return posts containing'pillow'
but not'sofa'
(available since Version 4.4).
Related Posts:
- Exclude custom taxonomy from search results and archive pages
- Search for tags
- Filter taxonomy terms using multiple id in the edit-tags.php
- If search matches taxonomy
- Check for taxonomy archive on search results page
- Extend & Search Native WordPress Image Galleries With Tags and Taxonomies?
- How to make tags show up in search results?
- WP Search using taxonomy terms
- Change searching from world level to first letter
- Including taxonomy in searches
- What is the ‘selected’ parameter in wp_dropdown_categories() for?
- Display taxonomy terms when adding a link in the admin
- How to perform unit testing on proposed patches in Trac?
- Can the default “post tags” taxonomy be renamed?
- Remove the category/taxonomy description field?
- How can I create a taxonomy meta-box with search suggestions but no new terms input?
- Add ‘Description’ to taxonomy ‘Quick Edit’
- Search custom taxonomy term by name
- get a specific taxonomy term name
- get_terms() How many is TOO many?
- Child Terms not Displaying on the Taxonomy Term Admin Screen
- How to display child term of current term’s parent taxonomy?
- Sorting custom taxonomy causes menus error
- Set a cookie in WordPress, using a select form and Jquery
- How to add terms to taxonomy with wp_insert_terms?
- Is there any difference between post in child term and child & parent terms?
- Create and move terms for taxonomies
- Custom taxonomy archive – No posts found [closed]
- Display parent taxonomy name and list child taxonomies below it?
- How can I remove links from the function “get term list”?
- Alphabetical order in taxonomy.php
- Get Term names from WP Term Object
- functions to create term and child terms
- base directories / URL
- WordPress REST get all items without a taxonomy assigned
- Getting the parent from the wp_term_taxonomy
- How do I get the current tag out of a taxonomy?
- Variable in Array Not Working
- How to list 2 taxonomy terms for a post, based on their hierarchy
- Showing custom taxonomy column in taxonomy category listings immediately after create category
- Custom Field as Custom Taxonomy?
- Order wordpress taxonomy parent terms by their children count
- WP_Query Not Recognizing Taxonomy Parameter in Custom Search
- Customising the search function?
- Modify the query method when adding category filtering function to the custom post list
- need to get postthumnails from a post whithin a category custom post type
- how to display only the sub category names of the taxonmoy
- Adding tag’s featured image to tag archive
- Searching for any images in media library displays “no media found”
- Group Post by Custom Taxonomy 2 under Custom Taxonomy 1
- Individual post. Meta_key, taxonomy or post status for separation?
- Taxonomy archive page WP_Query does not return get_the_permalink() or get_permalink() value
- Ordering Taxonomies / Changing term_id
- How to show taxonomy image instead of taxonomy name on a list
- benefits of the table ‘wp_term_taxonomy’
- How to save a multiple checkbox array into a non-hierarchical taxonomy
- `get_terms()` with `child_of` and `childless` combined
- Add text to the end of each list item in wp_list_categories
- echo term name outside the loop, using term slug
- What are these undocumented arguments for register_taxonomy?
- Dynamic filtering of posts with custom taxonomies
- Sorting tags by name
- How to display only the direct children of a term on a taxonomy page
- How to get terms from a custom taxonomies after WordPress 4.5.0
- Get an array of custom taxonomy with posts inside each items
- Display posts from tagchildren of taxonomy tagparents
- If has_term, load other theme
- archive page sidebar not working
- Tax Query trouble
- Bug using wp_insert_term with switch_to_blog
- Get something out from taxonomy
- get_term_by with a variable
- WordPress Default Category and Custom Taxonomy Selected Attribute not Working After Searched in wp_dropdown_categories Array
- Finding id of taxonomy by name in custom post type
- How to have article URL like example.com/article1 and example.com/foo/article2?
- How to display acf repeater in tag archive page?
- I want to edit the tags template by adding text that displays all tags from the listed posts
- Get Term ID by Description
- Can lots of tags affect performance?
- echo a tax term in loop
- I need posts within a taxonomy category that are tagged “featured” to show up first
- how to echo a custom taxonomy term from an array of term
- How to manage the links of a new taxonomy
- How to position taxonomy meta box on page
- WP REST API taxonomy is missing on custom post type
- How to add some filter to Category Taxonomy
- Get taxonomy url, name, post count & image
- Rewrite permalink to include multiple taxonomies
- taxonomy terms are not populating select tag options
- How to show amount of post in a taxonomy with advanced custom fields?
- Related Posts by taxonomy using Advance Custom Fields Plugin
- Help me add Taxonomy to byline
- How Can I List Categories by Date?
- Custom Taxonomy Page redirect 404
- Passing values by form to create a query
- Why is taxonmy-[taxonomyname].php not working?
- Adding Advanced Custom Fields to posts without hyperlinks
- How to display a term of taxonomy
- Add URL field to wordpress taxonomy
- Bulk import in custom taxonomy