Continue reading Polylang: Bilingual search

Polylang: Bilingual search

By default, Relevanssi indexes the different language versions of the posts separately. If your site is in French and English, searching for the English text will find the English posts and searching for the French text will find the French posts. But what if you want the French search terms to find the English post…

Read more Polylang: Bilingual search 8 Comments on Polylang: Bilingual search
Continue reading ACF: Indexing files from File fields

ACF: Indexing files from File fields

Relevanssi can index attachment contents from files linked to posts with ACF File fields. This does not happen automatically but requires some extra code. The code required depends on which return value you use for your ACF File fields. If you use “File ID”, the code looks like this: For “File Array”, the code looks…

Read more ACF: Indexing files from File fields 1 Comment on ACF: Indexing files from File fields
Continue reading WooCommerce: Searching for orders

WooCommerce: Searching for orders

Searching for shop orders is tricky with WooCommerce. WooCommerce blocks searching the orders. WooCommerce also keeps the order data in many different tables. Because of this complexity, the shop_order post type is not available for indexing. You can enable it by adding this to your site: This is not enough, though. The order use custom…

Read more WooCommerce: Searching for orders 0 Comment on WooCommerce: Searching for orders
Continue reading Indexing image captions for the posts

Indexing image captions for the posts

The use case is I run several newspapers, and the “caption” field when uploading media is where the journalists put the photographer credit. We need to be able to index the photographer bylines, but ideally would want to return the story/commentary where their image was used, not the image itself. If you want to index…

Read more Indexing image captions for the posts 0 Comment on Indexing image captions for the posts
Continue reading Indexing embedded PDFs for the parent post

Indexing embedded PDFs for the parent post

Relevanssi can automatically index PDF content for the parent post if the PDF (or other attachment) is attached to the parent post in WordPress. However, that’s not always the case. Sometimes the PDF is attached to the page using an embed, which doesn’t create a connection between the posts in WordPress. Thus, Relevanssi won’t know…

Read more Indexing embedded PDFs for the parent post 5 Comments on Indexing embedded PDFs for the parent post
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. Add this function to your site…

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 ACF: Indexing relationship content

ACF: Indexing 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 ACF: Indexing relationship content 2 Comments on ACF: Indexing relationship content