How to make search include data from wp_postmeta?
I have a site using Advanced Custom Fields to create and store various bits of relevant info. These need to be included in the main general search, which by default only searches the title and main content.
I’ve found plenty of info about getting search results based on specific bits of postmeta, but I have an issue with that. There are a potentially unlimited amount of potential fields in postmeta to search.
The solution could either search anything in postmeta or anything with a meta_key that matches this regex:
Example meta_keys to match are:
content_section_0_content_title content_section_0_content_title content_section_4_content_subtitle content_section_8_content_text
Any way that I can alter the fields searched to include the postmeta would be very much appreciated.