Continue reading Indexing post slugs

Indexing post slugs

By default Relevanssi does not index the post slug. It is, however, an easy thing to fix using the relevanssi_content_to_index filter hook. This function will read the post slug, replace the hyphens with spaces (so that indexing-post-slugs becomes “indexing post slugs”) and add the slug to the post content. Just add this function to your…

Read more Indexing post slugs 0 Comment on Indexing post slugs
Continue reading Gmedia photo gallery tags

Gmedia photo gallery tags

Gmedia photo gallery gives a false impression of working with Relevanssi, as you can see the gmedia_tag taxonomy appear in the list of taxonomies: However, if you try to index those tags, you’ll soon notice Relevanssi isn’t actually indexing them. That’s because Gmedia gallery doesn’t use that taxonomy for the tags. The tags are actually…

Read more Gmedia photo gallery tags 0 Comment on Gmedia photo gallery tags
Continue reading Indexing ACF relationship content

Indexing ACF relationship content

If your posts include content from related posts using the Advanced Custom Fields relationship functionality, Relevanssi doesn’t index that content by default. Even if you set Relevanssi up to index the ACF fields, the relationship fields do not include any content, just references to other posts. Those, even if indexed, are not particularly helpful. ACF…

Read more Indexing ACF relationship content 0 Comment on Indexing ACF relationship content
Continue reading Indexing product variation SKUs for main product

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. Just add this function to the theme functions.php and rebuild the index: add_filter(’relevanssi_content_to_index’,…

Read more Indexing product variation SKUs for main product 10 Comments on Indexing product variation SKUs for main product
Continue reading Advanced Custom Fields Relationship fields

Advanced Custom Fields Relationship fields

Update 16.1.2018: There’s a better post on this topic at Indexing ACF Relationship Content. I’m working on a website and i’m use A LOT the Relationship field au ACF. So on my pages are displayed informations of some related custom post. Is there a way to get that working in the search ? With some…

Read more Advanced Custom Fields Relationship fields 1 Comment on Advanced Custom Fields Relationship fields
Continue reading Indexing attachment filenames

Indexing attachment filenames

Relevanssi has been working nicely for the normal usecase. But how does one setup indexing of attachment files. When someone searches by filename or extension like pdf, there are no results. I have enabled ‘attachment’ at Relevanssi ‘Indexing options’ and still there are no results. Relevanssi doesn’t index attachment file names. For attachments, Relevanssi indexes…

Read more Indexing attachment filenames 0 Comment on Indexing attachment filenames
Continue reading Searching by post ID

Searching by post ID

Are post ID’s searchable in Relevanssi? No. Relevanssi does understand the WP_Query p parameter to restrict the search by post ID. However, if you want to search by post ID, it’s very simple to make that happen: add_filter(’relevanssi_content_to_index’, ‘rlv_index_post_id’, 10, 2); function rlv_index_post_id($content, $post) { $content .= " " . $post->ID; return $content; }add_filter(‘relevanssi_content_to_index’, ‘rlv_index_post_id’,…

Read more Searching by post ID 0 Comment on Searching by post ID
Continue reading How to index parent categories

How to index parent categories

Suppose you have a parent category with no products in it but a child category does. If you search by the parent category can relevanssi be set up to show the products in the child category? Cars > Wiper Blades. A search for cars shows wiper blade products. By default this does not work, because…

Read more How to index parent categories 0 Comment on How to index parent categories
Continue reading Relevanssi and BBPress search

Relevanssi and BBPress search

Relevanssi does work with BBPress. BBPress forums, topics and replies are regular WordPress posts. In order to get Relevanssi working with BBPress, you need to make Relevanssi index post type “topic” (forget “forum”, and I think it’s better if you skip “reply” as well). Since “topic” is non-public post type, you also need to uncheck…

Read more Relevanssi and BBPress search 4 Comments on Relevanssi and BBPress search