Continue reading Controlling attachment types in index

Controlling attachment types in index

Relevanssi lets you index attachments. But perhaps you only want to index a particular type of attachment? Relevanssi settings don’t have any control over that, it’s either all attachments or nothing. It is possible to choose which kinds of attachments are indexed. It is done with the relevanssi_indexing_restriction filter hook, which lets you control which…

Read more Controlling attachment types in index 16 Comments on Controlling attachment types in index
Continue reading Keyword-based search blocking

Keyword-based search blocking

Update: In Premium 2.15.0 and later versions, you can do spam blocking from Relevanssi settings. Just navigate to the Spam Block tab on Relevanssi settings! If your search logs are full of spam with repeating keywords, you’re being targeted by a spammer. Their goal is to get visibility to their malicious URLs, hoping Google will…

Read more Keyword-based search blocking 11 Comments on Keyword-based search blocking
Continue reading Restricting the indexing to particular user roles

Restricting the indexing to particular user roles

From the Relevanssi settings, you can only choose whether subscribers are indexed or not. If you need finer control over what user roles are indexed by Relevanssi, you can use the relevanssi_user_index_ok filter hook with the following code. Place it in your theme functions.php: Just adjust the $block_these_roles array to include the roles you want…

Read more Restricting the indexing to particular user roles 0 Comment on Restricting the indexing to particular user roles
Continue reading bbPress: Private Groups support

bbPress: Private Groups support

Private Groups is a plugin that makes bbPress forum groups private. Relevanssi, however, doesn’t understand that privacy and will show those groups in the search results. Relevanssi has means to support this, however, with the help of the relevanssi_post_ok filter. Here’s some code from Mark Wass that makes the private forum posts private in search.…

Read more bbPress: Private Groups support 0 Comment on bbPress: Private Groups support
Continue reading Utf8mb4 charset and index problems

Utf8mb4 charset and index problems

If you use utf8mb4 charset, Relevanssi database table may be missing an index. That’s because part of the index includes a column type that is of varchar(210) type. This is fine with utf8, but fails for utf8mb4, which only allows columns 191 characters long (because maximum column size is 767 bytes, and for 4-byte utf8mb4…

Read more Utf8mb4 charset and index problems 0 Comment on Utf8mb4 charset and index problems
Continue reading Relevanssi Premium as a Composer package

Relevanssi Premium as a Composer package

If you want to install Relevanssi Premium as a Composer package, you can use the following URL to fetch the latest version: https://www.relevanssi.com/update/fetch_latest_version.php?api_key=XXX Replace XXX with your valid API key. The URL will always return the latest version of the plugin files. If you want a specific version, you can use the following: https://www.relevanssi.com/update/get_version.php?api_key=XXX&version=2.20.1 The…

Read more Relevanssi Premium as a Composer package 0 Comment on Relevanssi Premium as a Composer package
Continue reading Category filter for search results pages

Category filter for search results pages

Sometimes it’s nice to have a category filter on the search results pages: a simple dropdown where you can choose the category you want to show. It’s easy to create one using wp_dropdown_categories() but on a search results page, that’s slightly problematic, as it’ll include all categories, not just those included in the search results.…

Read more Category filter for search results pages 33 Comments on Category filter for search results pages
Continue reading Infinite Scroll from Jetpack

Infinite Scroll from Jetpack

Jetpack has Infinite Scroll, which is a pretty cool feature, but unfortunately doesn’t work with Relevanssi on search results pages. Infinite Scroll uses WP_Query to get more posts, and that isn’t compatible with Relevanssi. I’m not aware of a solution that would allow Infinite Scroll to work with Relevanssi. There isn’t enough room for customization…

Read more Infinite Scroll from Jetpack 0 Comment on Infinite Scroll from Jetpack
Continue reading Adding extra boost for exact title matches

Adding extra boost for exact title matches

Every now and then, somebody wants to see exact title matches higher in the results. Usually, the best way to do this is to increase the title weight, maybe switch the default operator to AND and let the Relevanssi algorithm lift the best results. If that is not enough, you can use this code to…

Read more Adding extra boost for exact title matches 13 Comments on Adding extra boost for exact title matches
Continue reading Issues with post order plugins

Issues with post order plugins

If you’re getting low-quality results and the weight settings are not affecting the results, the first thing to check is to see if your results are coming from Relevanssi in the first place. That’s easy to check: disable Relevanssi and see if the results change. If the results change, they’re coming from Relevanssi. If the…

Read more Issues with post order plugins 0 Comment on Issues with post order plugins