• Resolved Dee444

    (@dee444)


    Hello,

    is there any chance to index only the specific custom field (ACF)?

    I use this filter to exclude post title/content from indexing.

    add_filter(‘relevanssi_index_content’, ‘contentoff’);
    function contentoff() {
    return false;
    }

    I need now the only custom field to be indexed.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter Dee444

    (@dee444)

    All I need to index on the site is the specific custom field. (it’s numeric)

    When I put a number to a search bar, I need to find a specific post which owns the number.

    I don’t want other post content and other acf fields to be indexed.

    Plugin Author Mikko Saari

    (@msaari)

    See “Custom fields to index” in Relevanssi settings. Add the name of the custom field there, then rebuild the index.

    However, if that’s all you want from the search, using Relevanssi (or any other search plugin) is overkill. You don’t really need a search plugin at all, you need a bit of code that returns the post matching the custom field. It’d be much, much faster and lighter that way.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Indexing only the specific custom field (ACF)’ is closed to new replies.