This is an 9 months question, but since I had the same issue and found a solution, I came here to post it.
On file wp-content/plugins/woocommerce/classes/class-wc-query.php
, function pre_get_posts( $q )
, WooCommerce defines at line 114:
add_filter( 'posts_where', array( $this, 'search_post_excerpt' ) );
This is the point when WooCommerce mess up your query!
The function search_post_excerpt
is defined right down, at line 132, and you can see he adds excerpt to the search query.
So you have 2 solutions:
The bad one, is comment the line 114!
//add_filter( 'posts_where', array( $this, 'search_post_excerpt' ) );
The good one, I didn’t implement myself, but should be something like add a filter on posts_where
that runs after WooCommerce and fix it. Or maybe remove the filter.
I’ll search better for the good solution, and I promisse I’ll post it here. But the bad solution do the job pretty well.
Related Posts:
- Media library – Limit images to custom post type
- Sort search results by post type
- Development of a WordPress Search Plugin – Best Practices
- echo value from ‘select’ field type into page template using cmb2?
- post_type_link filter causes 404 on the CPT page it’s used on
- Search everything (posts, pages, tags, cpt, meta)
- Include images from pages in wp search.php results in default wp search
- Separating Search Results By Post Type
- Used with meta_query in query_posts works slowly
- How to get Custom Post ID by adding filter to child theme’s function
- How to add the post ID (or any other post data) to a Contact Form 7 mail?
- GravityForm: Populate Dropdown with custom post type [closed]
- Filter categories of posts with checkboxes
- I did group my search results by post type, but how can i give each of them its own order?
- custom post type not showing in menu
- filter custom post type by meta key in dashboard
- WordPress sort search results by custom order
- search suggest – filter post type
- How to change permalink to include custom post type
- Search filter triggered & sort by custom post type
- Redirect to another page using contact form 7? [closed]
- ACF in wordpress
- Prevent A Specific Custom Post Type Showing In WP Search Results Page
- Custom post type’s posts are not showing anywere but in xml sitemap
- Custom post type in Custom widget – $listItem
- Send post changes to set email addresses (not users or subscribers)
- Modifying search results based on post_type
- Insert custom taxonomy into category query
- Include images from pages in wp search.php results in default wp search
- Post that populates itself (almost) automatically using data from imported excel file
- Enable shortcodes on custom post type
- Custom Search Template for Custom Post Types
- Diffrent search templates for different post types
- making a glossary with wordpress
- add_filter > posts_where works partially
- Simple Share Buttons Add Plugin and Custom Post Type
- Post the content of a specific “Custom Post Type” post within a post using a shortcode
- multiple search forms and search results
- Filter home_url for custom post type
- error in Advanced Search Form for Custom Post Types in WordPress array_key_exists() expects parameter 2to be array, string given
- Need functionality with all post list available at edit.php
- Add Content Exclusively to a Custom Post Type Feed
- Custom Taxonomy breaking pages permalinks
- Hide Meta Boxes for Non-Admins
- How do I set the link in the Custom Post Type admin menu?
- Search Custom Post Type Custom Fields
- Custom Post Type not appearing in website search
- Filter custom post type archive page with custom taxonomies (categories) with AJAX
- Issue to get wp_get_attachment_image with cmb2
- How to have the right design for a custom post type without accessing themes
- How to filter out post type meta?
- Best action hook to create custom post and assign taxonomy terms to it on plugin activation?
- Custom Fields vs Separate Table
- Remove default post types on all sites except primary blog. WPMU
- Add custom post type archives to search results?
- CPT Meta Searching
- CPT Search Form with Taxonomy filter & Or
- How to change the admin menu “Pages” to something else
- Loop through posts of a custom-post-type (event) and create .ics (iCal) file?
- Apply post formats to a specific post type only?
- How would I create a shortcode to display a custom post within a page or regular post?
- Custom Post Type | Fatal Error on register_post_type()
- Output custom post shortcode. Help spot the error.
- When ‘is_post_type_archive()’ return true?
- How to check if “is single” page
- Set object terms not working on plugin activation
- Keyword search limited to specific post type filtered by multiple custom taxonomies?
- Override plugin with functions.php
- How To Enable Block Editor (Gutenberg) for Existing Post Type via functions.php
- How to filter search results by post type?
- How to create an advanced filter search?
- Make a function to run only for CPTs
- WP Job Manager Category Drop-down; Change Placeholder Text Via Filter
- Custom search for custom post meta with pre_get_posts interferes with WP search
- How to search map address in custom post type?
- Modifying date filter on admin page for custom post type to link to custom field
- how to add extra meta box or textarea into custom post types
- Loading all files within a directory
- Add html to cpt main page / admin edit.php
- How to apply filter at search of woocommerce products?
- Modifying Custom Post Type after registration (will it affect content?)
- Custom Post Types relationships
- Custom Taxonomy Tag Search
- register_taxonomy and register_post_type does not work [closed]
- Custom search results page query, link permalink to post title while separating by post types
- How to retrieve category NAME instead of ID in a function with a taxonomy custom field?
- Create a post in custom post type using field in registration form after users submit form
- Pre_get_posts filter overwrites all search functionality
- “add_post_type_support” with Custom Post Type & ACF
- A good strategy to print custom posts (offer) that are checked inside the metabox of a post?
- Shortcode insertion in tab
- Custom Search for Drafts in Custom Post Type
- Copy custom field value to post title
- Can’t get order_by meta_value_num to work properly
- How to quickly reorder posts in the admin panel that will persist for the wp-api
- Pass info from functions.php to plugin
- Add CPT as subpage under custom page
- Insert HTML inside link in a walker
- right_now_content_table_end function not working?
- check if post title in a custom post type exists in page