This website uses cookies to personalize your experience. By using this website you agree to our cookie policy.

Reply To: Force Uppercase Search

#27254
Ernest MarcinkoErnest Marcinko
Keymaster

Hi,

Optimally, the table and the database collation should be a case insensitive one. By default WordPress uses a case insensitive table collation, but the database collation may override that. I strongly recommend changing the collation to a case-insensitive if possible, as it may prevent other conflicts as well.

First, I suggest trying to change this option here: https://i.imgur.com/kkfz4x8.png

If that does not work, then turn it off, and instead use a custom code, like this:

add_filter( 'asp_search_phrase_after_cleaning', 'asp_map_phrase_pattern',  10, 1 );
function asp_map_phrase_pattern( $s ) {
	if ( function_exists('mb_strtoupper') ) {
		return mb_strtoupper($s);
	} else {
		return strtoupper($s);
	}
}

This will force upper case at all times.