Indexing Shortcodes within custom field contents
How to index shortcode contents, which are within custom field contents.
Last updated
How to index shortcode contents, which are within custom field contents.
Last updated
By default shortcodes are not executed in custom field contents before indexing to avoid some known issues. In rare cases - such as using an ACF field with a Tablepress or any other shortcode it is neccessary.
Configure the index table engine as you need it, but don't index yet (Don't click Create New index button, if you did, just reload the page)
Make sure that the custom field, which contains the shortcode(s) is also selected. In this example I'm using "field_name" as the field.
Use the custom code below. Where do I put the custom code?
Make sure to change the $field_name variable to the custom field, which contains the shortcode(s)
Now create the index
Make sure that the index table engine is enabled on the search instance settings as well
The custom code snippet to index custom field with shortcodes: