Create a another filter to remove post title and post content remove search terms
try this if this helpful for you
add_filter( 'posts_search', 'custom_post_search_author_do', 10, 2 );
function custom_post_search_author_do($search, $query ){
if( ! empty($search)
&& $query->is_main_query()
&& !is_admin()
&& isset($_GET['search-type'])
&& $_GET['search-type'] == 'autor'
)
$search="";
return $search;
}
Related Posts:
- How Do I Use WP_Query to Run This Database Query as Search Result?
- How to create a custom search for custom post type?
- what is the correct way to compare dates in a WP query_posts meta_query
- Advanced search form with filters for custom taxonomies and custom fields
- Correctly delete posts with meta and attachments [duplicate]
- Prevent pre_get_posts filter on specific post type
- 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 everything (posts, pages, tags, cpt, meta)
- filter search result with custom post type meta key
- WordPress Admin Panel search posts with custom post meta values along with title
- Search results ordered by custom post types are not grouped
- Can’t sort order of wp_query with 2 meta keys
- Having trouble with custom post type / meta box
- How can I include meta box content when searching?
- Building an Advanced Search (text, tags, category, custom fields) – Getting the wrong SQL query
- Custom Post Type, Saving Multiple Checkboxes
- How to create an advanced filter search?
- Multiple meta_values in the pre_get_posts filter?
- Custom post type search using $_SESSION and pre_get_posts
- changing meta value and meta key of price field
- WordPress sort search results by custom order
- Update postmeta Parent when post_status child change
- How do i search authors from search form using author’s name
- how to show records that don’t have custom meta value
- Prevent A Specific Custom Post Type Showing In WP Search Results Page
- Search CPT Title AND Meta
- How to have multiple search result pages in wordpress with taxonomy terms listed
- WordPress CPT Taxonomy Dashboard Search – How to include taxonomy in search?
- Search for custom field input of a custom post type in ajax live search
- How to Disable option of meta field if that option is selected for any other post in custom post type?
- Stored meta from attachment, video length?
- custom search results – order results differently by post type
- Custom Post Search
- pre_get_posts not firing at all
- Advanced search form with filters for custom taxonomies and custom fields
- Search for portfolio tags & mixing portfoliotags and post tags
- Displaying One Custom Post Type’s Content On Single Post of Another Custom Post Type
- Convert Custom Table Data Based Plugin To Be Searchable
- Blank search results on custom search
- Multi Parameter search with custom post type category and tag
- Add Class according to the order of appearance
- CPT, meta-data, url parameter
- Related posts meta_query CPT
- Need to have an archive widget which organizes and displays a custom post type using a custom date field
- Custom Content Type with No Page View
- Limit search field to just search a custom post type with custom fields
- Meta box with front-end styling
- Sanitaizing Select Optin For Custom Post Type Metabox in WP
- How can I get some of a posts meta data whilst it is still inserting?
- How to hide a custom field from admin?
- Get terms for a specfic post from multiple taxonomies in custom post type
- Custom post type tags not showing in search
- Problems making shortcode with custom post types and taxonomy
- custom comment fields on CPT
- How to retrive Custom Post Type Meta Fields in Custom WP_Query
- Advanced custom field – posted fields from custom post type
- Cannot Save MetaBox Data in Custom Post Type
- delete duplicate meta_value with same post_id
- HM CMB: Post Select Field for CPT ID
- CMB select with data from CPT
- pre_get_posts works in post type archive but not in single post
- Getting WordPress to store 0 values for custom post type meta
- Add Class After 4th Post
- $wpdb is queried but results don’t show
- updating one custom meta field only
- cannot achieve this structure (custom posts VS categories VS ??)
- Post visibility option to theme front-end for author to select?
- How to list posts by term (custom taxonomy)
- Add a class to post_class if more than one post shares same meta_value_num
- Query Multiple Custom Post Types & Exclude a Taxonomy Term
- Building a Data Intensive Website with WordPress
- Function to return values from metabox
- How to keep a record of changes to a custom field?
- Function to add custom HTML into head in custom post-type list page
- Is it possible to have hierarchical taxonomy and hierarchical custom post types in one permalink?
- Add a meta field to the list of results for a custom post type
- best way to use custom taxonomy, post type and meta in a job system
- Empty meta-box returns publishdate if no value is set?
- Custom taxonomy not saving correctly
- Say I have a tech blog, how best would I store technical specs for a phone, if i use custom post types
- Display future posts in search
- Redirecting search to specific templates with $_GET[“post_type”]
- What is the best way to manage small blocks of content on my home page?
- How to create Custom image post?
- Building tags and archive using meta from custom post type
- How to order custom posts by one of the custom fields value, ‘date’?
- One post auto attached to many another items
- How set template for “custom post type” individual post
- Problem Saving Custom Post Type Meta Values
- Filter search posts by post meta?
- Custom Meta Box with variable number of fields
- Modifying search results based on post_type
- how to use custom post types collectively integrated with each other
- Use Gravity Forms and a Shopping Cart for output to Freshbooks for an Estimate [closed]
- Custom Post Type Implementation
- Related “custom post type” using “custom taxonomy”
- Why doesnt my tag page populate with this custom post type?
- How do I “trash” a custom post type post while logged in as Admin