add_action( 'init', function() {
add_rewrite_rule( '(.+)/search/(.+)/?$', 'index.php?post_type=$matches[1]&s=$matches[2]', 'top' );
} );
It works done.
Related Posts:
- what are the numbers between curly brackets in search query
- Search custom post type by meta data
- Search Terms – Querying on either description__like OR name__like in the same Term Query?
- search through post-type attachments titles
- Change searched term
- Search query -> Show all pages except certain template
- Temporarily storing main search result
- Query based on title, with ‘compare’ => ‘IN’
- is_search called incorreclty
- Issue with using add_rewrite_rule() for post querying custom fields
- Attempt to improve WP search, can someone check my SQL query?
- Searching With Apostrophe
- I want to create a filter for the query string is this possible?
- How to reset usual $query on search page to push custom $wpdb query there?
- Ideas how to search & replace post_content when string contains a newline?
- How to insert Collate into WordPress search query?
- Slow Search Queries – How to exclude pages, media, excerpt, authors, private posts?
- How to interfere to default search to make it search in custom fields?
- How to manage a particular “order by” for get_search_query()?
- Rewrite rule for query params
- WordPress search in modified post title
- Filter orders by modify date
- How to add url parameter to every search query in SearchWp?
- WordPress add_query_arg from ajax and make url friendly
- Restrict WordPress search to a single ACF field
- Modify behaviour of “s” parameter in wp_query
- Sort by postmeta on when searching
- Pagination adds search query (again)
- Speed up search query that searches in post meta?
- How to make MySQL search queries with quotes
- $query->set( ‘post_type’, ‘post’ ); not working
- search.php is not generating the right results
- Sort loop with query in the link
- Run search query again without pagination gives no results?
- Rewrite Query_Var URL Parameter with Slug
- How to Optimize WP site for millions of posts
- Get Terms by IDs with IDs order
- How many WordPress SQL Queries per page?
- Slow wp_enqueue_media()
- Advanced Custom Fields – Query Efficiency
- Why does wordpress still strip my query var?
- How to display lastest post date in the homepage?
- How to tell if $query_var isset?
- Custom search page and search by title, content and tag
- The use of including upgrade.php when building custom queries
- add_rewrite_rule not working for language specific characters
- Taxonomy.php issue with search and filters
- Slow meta_query with about 4 milion record on wp_postmeta
- How to show more than 5 posts?
- WordPress Find Duplicate Post By Content
- WP Query Sort by meta value (date)
- mySQL query. ORDER BY meta_key
- how to query multiple categories in wordpress?
- Disable the MySQL query in the main query
- Strange string in console from wpdb query
- How can I get the query that would be run for the archive page?
- Creating a custom search for a specific post type
- Query metas (and not : query posts by metas)
- Select query for a login
- What’s wrong with my $wpdb prepare?
- get_the_category and echo out link to child-most/deepest category
- where should I reset query after using get_results?
- wpdb print all post meta
- Form and custom query problem
- Export Specific User data without plugin
- Post 2 Post Site Search
- Search queries don’t seem to work?
- How to write: $wpdb->update having WHERE NOT value pair in the array
- Modify Search Query if original Query gave no results
- wpdb COALESCE won’t work
- Custom SQL Query passing array to WHERE p.id
- Query does not return content
- Query posts dynamic date range
- Parse query filter in wordpress and relation
- get posts by tag to showing in a widget
- Mysql query not working on WordPress 4.2.2
- get_post_meta with WP_query
- How to exclude custom fields from search queries?
- List WordPress Post and Related Attachments outside of a post page
- How properly create a blog template for wordpress?
- Problem on displaying the results on my query
- Improve performance of slow query
- Change search query in wordpress custom post type
- meta_query not working
- Cannot get sql request from Query object?
- Customising the default wordpress search functionality
- Heavy meta query causing SQL crash
- Pulling an ACF into a query
- How can I modify standard search query to include also ACF custom fields values?
- Using cron for multiple queries
- Need help setting up a search form for wordpress [duplicate]
- Set posts per page for parent category and it’s all children
- Exclude sticky posts from query
- If more than 1 image show post link?
- How to query different categories on index?
- How to specify what kind of is_single post?
- Can’t See Media Queries with Inspect Tool [closed]
- Print data from wordpress sql query
- Can I create my own query in wordpress with traditional methods?
- How to show sticky posts on all pages of the pagination, not just the first page?