Search by Custom Fields without a plugin

category:  WordPress

Lately, my client requires me to add the ability to search by custom fields at the backend. Today I gonna share what I did. There are three filters we will use. posts_join posts_where posts_distinct Below what page will be implemented. You can add the code below into functions.php or your own plugin. $_GET[‘s’] is the search input on the edit page. The posts_distinct filter is needed to prevent duplicate data. Yeap! that’s it. If you are looking for adding the … Read More