Support

Account

Home Forums General Issues Exact search with ACFs

Solving

Exact search with ACFs

  • Hello there!

    We’d like to have an exact search on our websites, also over all ACFs. Normally we’re using the WP plugin “SearchEverything”, but we figured out, that there are 2 problems when you’re using SearchEverything and ACF Pro together:

    1. ACF Pro does not remove the corresponding database fields, when a post becomes duplicated and its flex or repeater fields will be deleted. So SearchEverything will find content, that’s no longer up-to-date and therefor won’t be displayed in the frontend.

    2. If you’re using relation fields (we need them very often), SearchEverything won’t search in the related posts. As result of this, content that’s present in the frontend, won’t be found if someone searches for it.

    Please, have you got any idea how to fix these two insufficiencies or what plugin or tool to use, in order to get the right search results from all relevant ACFs?

    Thanks and best regards
    Michael

  • There are some premium search plugins that will solve the 1st problem. One of them can be found here https://facetwp.com/, there are others. It needs to be a search tool that will work with ACF and there aren’t that many of them.

    There is nothing that I am aware of that will search related content. That is search the content of a related post in a relationship field and consider it to be part of the post that’s being shown. If you do find a solution for this that works without needing to manipulate data in some way, please let me know.

    What I do for searching related content is that I build filters and actions that add the related content to hidden meta fields in the post. So, basically, all the content from all of the related posts is duplicated in the posts that are searched so that it can all be searched at once. I’ve even created a plugin that will do this integration. The main problem with this is all the extra content and custom fields that are required to make it work. https://github.com/Hube2/custom-field-converter

  • Dear John,

    thank you a lot for your quick and detailed response. To use FacetWP along with some actions/filters that store related content data in custom fields, seems to be a nice way to solve both issues. Of course it’s required to implement additional code, in order to create theses extra custom fields, but how can a plugin know, in which data of a related post to search in? 🙂

    I will have a look at your plugin later …

    Thanks again, so far

    Michael

  • It depends on what type of search you are doing really. If you are doing a keyword search you could probably use something as simple as Search Everything https://wordpress.org/plugins/search-everything/

    The thing is that you need to tell it where to search and the content needs to be part of the post you want to return as a result, usually in some hidden post meta field. WP and ACF have some limitations, the best that we can do is work around them.

Viewing 4 posts - 1 through 4 (of 4 total)

The topic ‘Exact search with ACFs’ is closed to new replies.