Include/Exclude custom field value based on context

[ad_1]

With Relevanssi Premium, you can use the relevanssi_match hook (see this documentation) for shutting down specific custom fields in the search based on a query parameter.

With the free version, the same method cannot be used, as the customfield_detail field that lists which custom fields match the search term is a Premium feature.

With the free version, you can do something similar and check the desired custom field value with get_post_meta() within the relevanssi_match function. That takes some care, as you can end up doing a ton of extra database queries (you want to do a single database query to fetch the custom field value for all posts at once and then use that data).

Or, you can do meta_query, that’s a fine approach, too.

Niiice! I have Relevanssi Premium, so I can make use of the customfield_detail detection. Will try this out. Thanks for your quick response. Stellar support as always! 🌟

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer