Skip to main contentSkip to footer

If your hosting provider blocks long database queries, Relevanssi Premium’s pinning and exclusion queries may trigger a “KILLED QUERY” error. You can reduce their size by adding this snippet to your site:

add_filter( 'relevanssi_pinning_query_size', function() { return 8 * 1024; } );
add_filter( 'relevanssi_pinning_max_query_size', function() { return 15000; } );

The relevanssi_pinning_query_size filter sets the normal query budget. The default is 16,384 bytes (16 KiB). This example reduces it to 8,192 bytes (8 KiB). Relevanssi splits the lookup into smaller queries while preserving the pinning and exclusion rules.

The size includes the complete SQL statement, not just the search terms. Smaller values produce more database queries. Accented characters and other multibyte text may require more than one byte per character.

Long individual phrases

If an individual phrase cannot fit within the normal budget, Relevanssi checks it in a separate query. The relevanssi_pinning_max_query_size filter sets the absolute ceiling for these queries. Its default is 32,768 bytes (32 KiB); the example reduces it to 15,000 bytes.

For hosts with strict query-length restrictions, set both filters. Reducing only the normal budget leaves the larger default ceiling in place for individual phrases. The default 16 KiB budget also exceeds a restriction of 16,000 characters.

If a phrase would exceed the absolute ceiling, Relevanssi omits that candidate and continues processing the others. That phrase cannot pin or exclude results, so a result excluded only by that phrase may remain visible. Relevanssi emits a development warning when debugging is enabled.

Both filters require an integer of at least 1,024 bytes. Invalid values use the corresponding default. If the normal budget exceeds the absolute ceiling, the ceiling takes precedence. Confirm your hosting provider’s limit before increasing either value.

Your account

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

Search

Popular Resources

Related Posts:

Comment Section:

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