Support

Account

Home Forums ACF PRO Making ACF data available to wp_search? Reply To: Making ACF data available to wp_search?

  • @LudovicFauchet
    Thank you for the suggestion, unfortunately this plugin does not go deep enough in my case.

    Although I have tried another plug-in with a similar function that adds more granularity to what is extended to the system as searchable content.
    http://bestwebsoft.com/plugin/custom-fields-search/

    This plugin exposes custom fields set by AFC to the WordPress system search. It looks like the way sub_fields are stored are not global per-say; instead these are stored in a serialized manor inside of it’s global parent AFC field.

    Example:
    If I wanted every SKU available from every product item, regardless of it’s product group. The sub_field for product_group/product_item/item_sku is only available via a serialized instance/variant of the global product_group AFC field.

    Data available to custom field search plugin:
    Product_group
    Product_group_0_
    Product_group_0_group_description
    Product_group_0_group_image
    Product_group_0_group_title
    Product_group_0_prodcut_item
    Product_group_0_prodcut_item_0_item_description
    Product_group_0_prodcut_item_0_item_images
    Product_group_0_prodcut_item_0_item_sku
    Product_group_0_prodcut_item_0_item_upc

    As you can see any given product item’s data is only available if I directly target/choose to add the serialized product_group_#/product_item_# to the list.

    Ideally it would be nice to have sub_field data exposed just like the parent fields, not a serialized instance of a parent.

    Current: Product_group_0_prodcut_item_0_item_sku
    Ideal: Product_group_prodcut_item_item_sku

    Making sub_field references available globally regardless of a serialized parent relationship.

    As a sudo fix for my problem,
    I’ve also set up some top level fields for SEO, mainly a meta description and keywords for each page/product. Via the custom field search plugin, I’ve added my SEO fields to it’s list.

    Now when product info is entered into a page, we also copy the SKU and name for each item into the keywords input. Then that data is available to the built in search.

    Please excuse the long post,
    I wanted to be thorough and share my plight on this mater to hopefully gather more incite into the gray area of AFC content & Search integration.

    Thanks,