WooCommerce product search titles only

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.