Just extend your search form with a hidden input: (notice the last input field)
<form role="search" method="get" class="search-form" action="<?php echo home_url( "https://wordpress.stackexchange.com/" ); ?>">
<label>
<span class="screen-reader-text"><?php echo _x( 'Search for:', 'label' ) ?></span>
<input type="search" class="search-field" placeholder="<?php echo esc_attr_x( 'Search …', 'placeholder' ) ?>" value="<?php echo get_search_query() ?>" name="s" title="<?php echo esc_attr_x( 'Search for:', 'label' ) ?>" />
</label>
<input type="submit" class="search-submit" value="<?php echo esc_attr_x( 'Search', 'submit button' ) ?>" />
<input type="hidden" value="product" name="post_type" id="post_type" />
</form>
Related Posts:
- Disable Redirect to Product Page on Search Results Page in WooCommerce [closed]
- Improved WordPress search functionality and search form plugin
- Different search results with WordPress and Relevanssi
- how to limit search to post titles?
- How does WordPress search work behind the scenes?
- Remove some pages from search
- WordPress blog with 30 000 posts: poor search performance
- How do I filter the search results order?
- Link to search page without search parameter
- Search/Replace for editor in HTML-mode
- Do I need to sanitize WordPress search query?
- Tracing the life of a query
- Neither the_excerpt() nor the_content() works properly?
- WordPress 3.6, searchform.php problems
- Add custom parameters to JSON API search query?
- Separating Search Results By Post Type
- How to stop _wpnonce and _wp_http_referer from appearing in URL
- Return all Tags from search results
- Search results with custom loop don’t update when paged
- Does WP search natively return results sorted by type (post, post type, page, category…)?
- How do I properly redirect outbound links with special characters
- Refine Search Results
- Creating search filter through plugin
- Display Categories in Search Results
- intellisense in wp search
- Is it possible to search authors by profile field?
- Search result conditonal tag
- Get search term not on searh results page?
- How to apply filter at search of woocommerce products?
- Custom Taxonomy Tag Search
- Search Result from another wordpress website
- Remove WHERE conditions from search query
- Change default search URL slug in wordpress with Custop Post Type as Search target
- Transliterating search term in another language
- How to exclude events (custom posts) from search, if the start date has already passed?
- How to conditionally pass a parameter to wordpress search to limit post types?
- How do I use a block to display search results?
- How to make search include data from wp_postmeta?
- Change WordPress search Permalink structure
- How to load WP categories into array for autocomplete?
- Custom SQL query on wp_users with the addition of wp_usermeta
- Media searching ignored
- Generate list of tags from search results
- Use created page as search results page and custom template
- Home page shows recent post, serps rank post within homepage
- How do I search dynamically created content?
- Post 2 Post Site Search
- Using search.php without a ‘s’ field in searchform.php
- Search queries don’t seem to work?
- Array_search ignoring the first element [closed]
- Add Icon to Placeholder Text in Search Form
- Unexpected esc_html and esc_attr behaviour
- Send admin an email when a user’s search has no results
- Modifying post content with the_post action hook
- Trying to remove plural ‘s’ from search Query but it’s just removing every letter of the end – what am I doing wrong? Thanks
- Blog search just returns to front page (not search results!)
- Search within table?
- How to insert meta keyword to search result page
- Custom search Dashboard widget
- Disable character’s replace in search
- Search and Filter Plugin – How to disable redirection
- WordPress Search Form Issue | Misleading search URL. | Pointing to wrong URL
- WordPress Multi-Step Product Search
- Echoing home_url() returns current url in searchform.php
- Exclude posts with certain meta data from search results
- Remove Page Timestamp via functions.php so it doesn’t show in Google Search Result Description [closed]
- Use pre_get_posts to display search results by meta in specific order
- Prevent search query from taking place when using Google CSE?
- Site Title in my Search URL
- I want empty search returns to home page in my wordpress
- Prevent searches less than 4 characters
- Search wordpress using three different drop down menus
- RSS feeds for specific topics
- How to get search result as image rather than page
- Search results – 404 error after hitting enter
- Redirect wordpress search query if its a tag
- Is it possible to show subdomain posts in main domain search result?
- Replacing word in wordpress Search not working Properly
- How to add search box to table results in admin page [closed]
- How might I go about using the API to search for a user by email, but ensuring that it is an exact match?
- Add CPT to search results with pre_get_posts
- Include images from pages in wp search.php results in default wp search
- Replacing wordpress search with custom code
- Change output URL Search module
- Remove Url Parameter WordPress
- search for single meta_key with numeric array of meta values
- How to customize default wordpress search query
- Customizing Google’s Search box in WordPress [closed]
- I’ve messed up the admin search functionality. Help!
- Content instead Excerpt on term
- Custom search results page not showing excerpt
- Search for Author and Custom Post Type
- Search page isn’t returning any results
- Error when searching without any results
- Listing parent section in search results
- Search results: How to add direct jump to anchor?
- wordpress Search function is not working
- Limit search to posts and pages
- How make Autocomplete with wp_query in post_type attachment
- Wp admin: I need search meta key from table wp_usermeta in screen custom post type