Skip to main contentSkip to footer

By default, the search ignores German umlauts. Searching for “uber” will also find “über” and so on. This ignorance is not a Relevanssi feature but instead governed by your database. The default database collation WordPress uses (utf8mb4_unicode_ci) ignores all accents, including umlauts.

wp_relevanssi database table, with collation set to utf8mb4_unicode_ci

If you want the search to care about umlauts, you can change the collation. For German, use utf8mb4_german2_ci (actually, use utf8mb4_swedish_ci, see comments below):

wp_relevanssi database table, with collation set to utf8mb4_german2_ci

Now, the database will not ignore umlauts. Relevanssi also removes accents to match what the database does, so you must also undo that. Add this to your site:

remove_filter( 'relevanssi_remove_punctuation', 'remove_accents', 9 );

Once you’ve done these steps, rebuild the index. Now, the search should not ignore the umlauts.

Your account

Not logged in. Log in to see your license details.

Search

Popular Resources

Indexing term slugs

I have a term who name is for, example, Great Blue Trojans. The slug is GBT. I want to be able to search for ‘GBT’ and return all the posts with this term. When I search ‘Great Blue Trojans’ I get the hits. When I search GBT I do not….

Brizy Pro
Brizy is another WordPress site builder and as usual, it too has hard-coded queries that don’t play nice with Relevanssi.…

Related Posts:

Comment Section:

1 Comment. Leave new

  • Sorry, but the info “If you want the search to care about umlauts, you can change the collation. For German, use utf8mb4_german2_ci” is WRONG.

    You need to use utf8mb4_swedish_ci, like always.
    It might have worked in some specific use case, but with any other current MySQL or MariaDB server, swedish_ci is the better option, as you will ACTUALLY get umlauts – as one expects – in the term column.

    I repeat: NO, DO NOT use utf8mb4_german2_ci, because that doesnt store umlauts. Yes, it allows for querying anything with “ue” as if it was “ü”, but it DOES NOT STORE words with umlauts, sz-ligature.

    Reply

Leave a Reply

Your email address will not be published. Required fields are marked *

Fill out this field
Fill out this field
Please enter a valid email address.
You need to agree with the terms to proceed