WP search automatically replaces lithuanian characters to standart (ą => a, č => c, ę = > e). How to disable this auto replacing?

For example: when I type "č" in search field, I also get results with "c" like "Asus Acer".


Try to change collation with the following code in functions.php

add_filter( 'posts_search_orderby', 'alter_query', 20, 2 );
function alter_query( $orderby, $query ) {
    return $orderby . ' COLLATE latin1_general_ci';
  • Thank you for the answer. Are you about wp-includes/functions.php? – Mister Tango Feb 20 '18 at 21:54
  • 1
    No! Never touch the core. I mean functions.php of your theme. – KAGG Design Feb 20 '18 at 22:06
  • Hmm, I just added your code at the end of themes/design/functions.php, but nothing happens :( – Mister Tango Feb 20 '18 at 22:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.