Hello,
I notice that my custom fields (Wysiwyg in repeatable fields) do not appear in the native search-form of WordPress.
My repeatable Wysiwyg are in a post taxonomy, so I don't have access to edit this taxonomy natively to fill in "include to the search form".
Do you have a solution?
Here is an example:
When I search for "gym", I have no results here: hidden link
when in fact this word exists here: hidden link
Hello,
I assume you are using Relevanssi plugin to setup the WordPress built-in search feature.
If it is, this is a limitation of Relevanssi plugin, see their document:
hidden link
1) You can only do this with Relevanssi Premium because the free version of Relevanssi can’t index taxonomy terms.
2) Relevanssi won’t index these taxonomy custom fields because taxonomy terms aren’t generally allowed to have custom fields
3) As a workaround, you can use the relevanssi_taxonomy_term_to_post filter, for example:
a) Use relevanssi_tax_term_additional_content filter hook to create a custom PHP function
b) In this PHP function:
- get assigned taxonomy terms:
https://developer.wordpress.org/reference/functions/wp_get_post_terms/
- Get the your custom taxonomy fields values, add those values into Relevanssi index
https://developer.wordpress.org/reference/functions/get_term_field/
Hello,
Sorry but I don't use any plugin for search. It is the native one of WordPress that I would like to adapt to take into account the custom fields of Toolset Types.
Do you have another track?
Quentin
No, there isn't such kind of built-in feature within Toolset plugins, you can follow our document to use Relevanssi plugin with Toolset plugins:
https://toolset.com/course-lesson/searching-texts-in-custom-fields-with-toolset-and-relevanssi/
Then use the workaround I mentioned above to include the term fields in the search
I finally added a development by myself that queries the database to display the posts.
Thanks for your insights
Quentin