WordPress Filter Posts By Custom Field Value In Admin

Searching for posts or pages in the WordPress admin by default only includes titles and body content. If you want to search by custom fields in the WP Admin Edit Posts / Pages page then you can install this plugin or script.

via Bainternet on WordPress StackExchange

Published by

Andy Brudtkuhl

Andy is a full stack web developer, growth hacker, entrepreneur, bike commuter, seinfeld enthusiast, and daddy to three little girls and two dogs in Iowa.

12 thoughts on “WordPress Filter Posts By Custom Field Value In Admin”

  1. I have your code up and running, I pasted it into my functions.php file and it worked like magic. My only question can I limit which custom fields are displayed in the dropdown based on my custom post type? Right now the filter fields are every custom field that’s used on the site. I have a custom post type called “property” and want only the custom fields for this post type to be displayed. Any ideas?

    Thanks for your help, this is an awesome piece of code!

  2. Hi,

    Thanks for the script, it’s fantastic!

    I just need to modify the WHERE sentence using the LIKE instad of the “=”, so I can search using parts of the custom field
    How can I do that? Where I have to edit the WHERE part?

    Thanks
    Cristian

  3. Awesome!! Works smoothly!
    I almost missed how it works!!
    A screenshot would help other distracted entrepeneurs from missing its success!

Leave a Reply

Your email address will not be published. Required fields are marked *