Home › Forums › Product Support Forums › Ajax Search Pro for WordPress Support › Force Uppercase Search › Reply To: Force Uppercase Search
May 12, 2020 at 7:29 am
#27254
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.