Filter search result with custom post type meta key

Posted by Prem Tiwari | Updated on

This might not have worked before, but WordPress’s meta queries now support the relation parameter. To complete what @s_ha_dum was looking to do, simply add the relation parameter (as OR) and add a second meta query for NOT EXISTS.

Example:


If you like this question & answer and want to contribute, then write your question & answer and email to freewebmentor[@]gmail.com. Your question and answer will appear on FreeWebMentor.com and help other developers.

Related Questions & Answers