• Hi,

    I activated Relevanssi on my website and enabled the ‘all’ custom fields option.

    However, I noticed that ACF options fields are not included in the list of indexed custom fields.

    The situation is like this, I have custom options in the back-end with ‘FAQ’ fields. The content of these (text) fields is then displayed on the FAQ page of my (custom) WordPress theme.

    When people use the search functionality on my website, I want the search results to include the FAQ page as well.

    Is it possible to make Relevanssi search in ACF options? Or should I instead create regular custom fields instead of ACF option fields?

    Thanks!

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Mikko Saari

    (@msaari)

    Relevanssi searches in posts, so when you index, Relevanssi indexes each post and the ACF fields related to that post. The ACF options are not connected to any post.

    This means you need to tell Relevanssi where to add the FAQ option content. You can create a filter function on the relevanssi_content_to_index hook that adds the option field contents to the FAQ page. See the documentation here.

    Thread Starter icola007

    (@icola007)

    Hi,

    Thanks a lot for that!

    If I wanted to make it work a bit more ‘out of the box’ without having to add additional logic on top of Relevanssi, would it work if I add the FAQ content fields to the FAQ page instead? In that case, the fields would be connected to a page and would probably be indexed by Relevanssi right?

    Plugin Author Mikko Saari

    (@msaari)

    Correct, Relevanssi has no problems indexing the fields connected to a post.

Viewing 3 replies - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.