Home › Forums › ACF PRO › What is the best solution for a page searches with ACF Contents? › Reply To: What is the best solution for a page searches with ACF Contents?
Search everything is a quick solution https://wordpress.org/plugins/search-everything/, but it will have some performance issues if you have a large number of custom fields. I’ve actually seen this plugin cause sites to time out so you need to be careful where you use it.
Your best choice is to create a pre_get_posts filter. There is a simple example of altering search results in the docs https://codex.wordpress.org/Plugin_API/Action_Reference/pre_get_posts
As far as displaying the values in the custom fields on search results, just like everything else in ACF, you’ll need to modify the template that shows the search results, usually search.php in your theme folder.
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
🚀 This week’s session of ACF Chat Fridays dips into the preliminary results of our first ever user survey. Don’t miss it! https://t.co/3UtvQbDwNm pic.twitter.com/kMwhaJTkZc— Advanced Custom Fields (@wp_acf) May 9, 2023
© 2023 Advanced Custom Fields.