Have you tried adding this hidden field to the search form?
<input type="hidden" name="post_type" value="news" />
For value=””, you should include the name of your custom post type, of course.
Related Posts:
- Extending the search context in the admin list post screen
- Advanced search form with filters for custom taxonomies and custom fields
- How can I change the admin search posts fields?
- Development of a WordPress Search Plugin – Best Practices
- Admin Area Custom Type Search By Meta Fields Without Title & Content
- Search multiple custom fields by using meta_query
- How do I Paginate Search Results for Custom Post Types?
- Search that will look in custom field, post title and post content
- Search everything (posts, pages, tags, cpt, meta)
- Search Custom Post Type with all meta attached?
- WordPress Search documentation: how to improve search query using taxonomy terms, custom meta fields?
- Backend search; include CPT meta?
- Custom Fields vs Separate Table
- Including Custom Meta with posts_where query
- search also in taxonomy, tags and custom fields
- How to stick custom post at the top in search results
- Filter custom posts using auto populated dropdown selectors
- Including metaboxes from custom post types in global search — continued
- Displaying and searching Custom Posts
- Searching Custom Fields
- filter search custom field query
- How to let users choose where to search for posts?
- Add custom attributes to a post
- Custom Taxonomy Search result page
- search custom post type by custom fields on front end
- Category Search / Custom Post Type search on my website. Custom Post Types that are “page-like”?
- Best way to create a search for custom post type by custom field values
- Filtering custom posts by custom fields (ACF) [closed]
- Search CPT Title AND Meta
- Advanced search form with multiple custom fields
- Search facility with directories
- Search form to find custom meta box generated data
- Is it good practice to search for custom posts based on custom field values?
- Advanced search form with filters for custom taxonomies and custom fields
- Hide custom post type field from author?
- echo value from ‘select’ field type into page template using cmb2?
- wordpress plugin error handling
- The right way to create a custom search page for complex custom post types
- How to solve suspected memory issue in custom WordPress loop?
- Trying to save custom post type from frontend partially working
- Comparing timestamps in meta query doesn’t work
- Is there any performance consideration when using Custom Post Types?
- How to create an advanced filter search?
- Create a random unique 6 digit number as custom field for custom post type
- Get all Posts If has same custom field values in Posts
- Rewrite and custom post type: order by custom field not working
- wp_query check if integer exists in custom field’s array
- Add field to all custom post types
- How can I use get_post_meta with add_rewrite_rule to build custom permalinks?
- Visual editor issue by having multiple tiny mce editors in a CPT
- Meta Query Filtering not working on Custom Meta Box using Radio Buttons
- Dynamic dropdown select values depending on other custom field value
- Include related custom fields from one post type in another post type’s JSON feed
- Admin Custom Meta Box – Pull Last 5 Posts from Custom Post Type
- Importing Data from a Non-WordPress database, into WP
- dropdowboxes with pre-selected custom fields optios that filters the results according seach needs
- It’s possible to hide body copy box for a custom post type?
- How can I add a custom field to an existing custom post type?
- Display Repeatable Meta Box Content
- Select2 AJAX and WP Query Returns ALL and does not filter
- WP_Query orderby not work with meta_key
- Having Issue on Ordering CPT by Custom Field In Custom WP Query
- Custom Field not saving in WordPress
- Reusable metabox backend and frontend
- How to display wp_post by custom field value?
- How can I modify a custom post type and custom page template for a child theme if all content seams to be handled by theme’s ‘native’ plugin?
- Get A Custom Field From A Custom Taxonomy Of A Custom Post Type [closed]
- Searching post types
- Let users upload image(s) to the post from front end
- How to import database table as custom post type and custom fields?
- Insert custom fields to a custom post type
- How to display posttypes and taxonomy in standard posts, not in a separate label?
- Fill custom fields when saving custom post types
- Should i use custom post type for a custom footer?
- Use Gravity Forms and a Shopping Cart for output to Freshbooks for an Estimate [closed]
- How do I ensure that post_type and Taxonomy use the same slug?
- How to make an API call to a custom post type but filtering by meta value?
- Migrate Custom Post Type with Custom Fields data and parent child order
- Custom Form / Search with Custom Post Type Data
- Is it possible to get the specific content on the search page?
- Search for custom field input of a custom post type in ajax live search
- wp_set_object_terms creates taxonomies but does not add custom posts to it
- Custom Column in CPT admin table not updated after Quick Edit save
- Display Custom Field or Custom Taxonomy in front page /post/product
- PHP Warning with Custom Fields
- filter rest api post by a acf filed
- Search in multiple specific post types
- custom search form for custom post
- Custom post url in search.php isn’t the correct rewrited url
- How do I extract the contents of a CPT’s custom field for all posts?
- How to delete comma from the end of results? [closed]
- Publish post and create additional posts with same content
- Converting a checkbox filter for custom fields to a dropdown
- pre_get_posts not firing at all
- Custom field totals
- If i have custom post type with 5 custom fields do i have to create a new loop to reference each one?
- How to show animal lineage/pedigree in WordPress?
- WP_Query arguments: Loop through custom post type – get all entries except excluded meta_key?
- Show Posts in Vertical Tabs with Scrollbar
- Custom Sort Order for Custom Post Type Taxonomy