Continue reading Showing only one recurring event

Showing only one recurring event

Some event calendar plugins do recurring events by creating many posts. That’s fine until those cloned posts fill up your search results. This function will only show one of each post with the same title and will take the one with the first date. The date is checked from _EventStartDate custom field, but it’s easy…

Read more Showing only one recurring event 2 Comments on Showing only one recurring event
Continue reading WooCommerce: Indexing product variation SKUs for main product

WooCommerce: Indexing product variation SKUs for main product

Relevanssi can index product and product variation SKUs for WooCommerce products: just add _sku to list of custom fields to index. However, if you want to find the main product when searching for the product variation SKU, you need some extra code using the relevanssi_content_to_index filter hook. Add this function to your site and rebuild…

Read more WooCommerce: Indexing product variation SKUs for main product 16 Comments on WooCommerce: Indexing product variation SKUs for main product
Continue reading Scroll result page to the search term

Scroll result page to the search term

Relevanssi can highlight search terms on the posts. But how about scrolling the page to show the location where the search results are? That is also possible. It requires a bit of JavaScript on the post page. This script needs to run on the post page: The easiest way is to just add this to…

Read more Scroll result page to the search term 11 Comments on Scroll result page to the search term
Continue reading Indexing private custom fields for admins only

Indexing private custom fields for admins only

I use private custom fields. I want to index them in the administration but not on the public site. How to do ? Initially this seems impossible to do with Relevanssi, but it’s possible. Doing this requires Relevanssi Premium. The free version doesn’t know which custom field matches the search term, it just knows some custom…

Read more Indexing private custom fields for admins only 0 Comment on Indexing private custom fields for admins only
Continue reading User Access Manager

User Access Manager

Relevanssi has a conflict with User Access Manager plugin. Both plugins attach to the same `the_posts` filter hook with the same priority, and if UAM runs after Relevanssi, it may cause some issues, like missing excerpts or even broken search results pages. The solution seems simple, however: at least in the one case I’ve run…

Read more User Access Manager 5 Comments on User Access Manager
Continue reading WooCommerce: Hidden products in search

WooCommerce: Hidden products in search

Relevanssi by default shows out-of-stock and excluded from catalogue WooCommerce products in the search results, but hides those set to excluded from search (before 2.2.2 and 4.1.2 the default behaviour was to show all products). It is quite easy to make Relevanssi not display hidden products in the results. The best way is to unindex…

Read more WooCommerce: Hidden products in search 23 Comments on WooCommerce: Hidden products in search
Continue reading Menu problems in multisite search

Menu problems in multisite search

Sometimes multisite searches cause problems in navigation menus. This is caused by pages from another subsite going into the page cache, and then replacing a page in the navigation menu with the same page ID. If you’re having this problem, adding the following code to the theme functions.php should solve the issue.

Read more Menu problems in multisite search 0 Comment on Menu problems in multisite search
Continue reading Indexing usermeta fields in Relevanssi

Indexing usermeta fields in Relevanssi

Relevanssi Premium can index user profiles. Users may have meta fields attached to them: there’s a wp_usermeta database table, even though the user editing interface by default doesn’t have any tools to add meta fields to users. Codex includes documentation on how to use the user meta fields. Read Working with User Metadata for code…

Read more Indexing usermeta fields in Relevanssi 2 Comments on Indexing usermeta fields in Relevanssi