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 ACF: Filtering custom fields by type

ACF: Filtering custom fields by type

On sites where ACF fields are used a lot, with Flexible Content and Repeater fields, it may be difficult to make Relevanssi only index the relevant ACF fields. One way to deal with problem is to set Relevanssi to index “visible” custom fields and then restrict the indexed fields by field type. Add this function…

Read more ACF: Filtering custom fields by type 0 Comment on ACF: Filtering custom fields by type
Continue reading ACF: Field names appearing in excerpts

ACF: Field names appearing in excerpts

With Advanced Custom Fields, sometimes Relevanssi picks up custom field names to include in the excerpts. This problem happens when you set Relevanssi to index all visible custom fields and have Flexible Content fields. Let’s assume there’s a Flexible Content field with the name flexible_content. It has a layout named field_layout, and in that layout,…

Read more ACF: Field names appearing in excerpts 4 Comments on ACF: Field names appearing in excerpts
Continue reading ACF: Indexing File field title

ACF: Indexing File field title

I use the ACF field type File for a download section, but the displayed file title is not indexing. The format I return the ACF field data is “File Array (array)”. For Relevanssi, it doesn’t matter which ACF return format you choose. Relevanssi doesn’t use get_field() but instead uses the plain get_post_meta(). That always returns…

Read more ACF: Indexing File field title 0 Comment on ACF: Indexing File field title
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