Your Internet Explorer is too old :( Please upgrade to latest IE or switch to Firefox/Google Chrome for better view!

September 23, 2014

WordPress Search in Tags, Categories, Taxonomies and Meta Keys

WP Extended Search is lightweight search plugin for WordPress. It has smooth and simple search settings to modify default WordPress search query.

Key feature of plugin is it gives the ability to select Meta keys, tags, category and custom taxonomies so admin can choose single or multiple Meta keys and taxonomies to include in search query. For instance if admin wants to include a meta key Location which have terms like loc1, loc2, loc3 then admin can only select this meta key to include in search results and if user put loc1 in search query then the posts related to loc1 will comes up.

  • Search in selected meta keys.
  • Search in selected in-built or custom taxonomies.
  • Search in post author name
  • Include or exclude any public post type.
  • Control whether to search in title or content or both 
  • Exclude old content from search results (Older than admin specified date)
  • Customize the number of posts to display on search results page
  • Customize SQL relation (AND/OR) between search terms
  • Translation ready
  • Download plugin from here WP Extended Search 
  • Upload and activate the plugin.
  • Go to Settings -> Extended Search and choose your desired settings.
  • By default, plugin have wordpress default settings you need to change the settings according to your requirements. You can also revert the settings to default by clicking “Reset to WP default” 
  • Settings have OR relation with each other. For instance if user searches for "hello world" then both words or any word (You can customize this relation since version 1.1) should be present in title or content or tag or category etc whatever options are selected.
  • Plugin do not affect search results in admin screens.
  • Meta keys, which starts with (_) underscore, are not available to select, as these are wordpress default Meta keys which do not have humans readable values.
  • Only those post type and taxonomies are available to select which have UI and public visibility. 
  • Search settings are global and alter every search query.
Action/Filters Hooks:
  • wpes_meta_keys_query
    Filter SQL query for listing meta keys in plugin settings.
     * Select all meta keys including those start with _(underscore)
    function wpes_meta_keys_query($query) {
        global $wpdb;
        $query = "select DISTINCT meta_key from $wpdb->postmeta ORDER BY meta_key ASC";
        return $query;
    add_filter('wpes_meta_keys_query', 'wpes_meta_keys_query');
  • wpes_tax_args
    Filter arguments array used by get_taxonomies for listing taxonomies in settings.  
     * Display only custom taxonomies
    function wpes_tax_args($args) {
        $args['_builtin'] = false;
        return $args;
    add_filter('wpes_tax_args', 'wpes_tax_args');
  • wpes_post_types_args
    Filter get_post_types argument array used for listing post type in settings.
     * List only custom post types
    function wpes_post_types_args($args) {
        $args['_builtin'] = false;
        return $args;
    add_filter('wpes_post_types_args', 'wpes_post_types_args');
  • wpes_enabled
    Filter to enable/disable plugin functions for any specific condition.
     * Disable WPES when query string variable disable_wpes is true
    function wpes_enabled($enabled) {
        if (!empty($_GET['disable_wpes'])) {
            return FALSE;
        return $enabled;
    add_filter('wpes_enabled', 'wpes_enabled');
  • wpes_meta_keys
    Filter meta keys name.
     * Insert only one key that start with underscore
    function wpes_meta_keys($meta_keys) {
        $meta_keys[] = '_key_with_underscore';
        return $meta_keys;
    add_filter('wpes_meta_keys', 'wpes_meta_keys');
  • wpes_tax
    Filter Taxonomies array return by get_taxonomies
     * Insert specific taxonomy in the result return by get_taxonomies
    function wpes_tax($taxonomies) {
        $my_tax = new stdClass();
        $my_tax->labels->name = 'Custom Tax';
        $taxonomies['custom_tax'] = $my_tax;
        return $taxonomies;
    add_filter('wpes_tax', 'wpes_tax');
  • wpes_post_types
    Filter post types array return by get_post_types
     * Insert specific post type in the result return by get_post_types
    function wpes_post_types($post_types) {
        $my_post_type = new stdClass();
        $my_post_type->labels->name = 'Custom Post';
        $post_types['custom_post'] = $my_post_type;
        return $post_types;
    add_filter('wpes_post_types', 'wpes_post_types');

 Please use support forum for queries or support!


  1. Hello

    How can I use your plugin in this way ?

    1. Hi,

      Currently query string is not supported yet.

  2. How can you set the plugin that search only shows pages an posts that have the tag name.

    I have checked tags in the settings, and removed the ticks next to search in title en search in content.

    1. Hi, You can only set search in tag and post type to post and page. Then someone will search for tag the posts/pages will comes up with that tag. Currently you can not limit the search to posts/pages those have particular tag. Also i kindly request you to please post on forum for furture queries for better support.

  3. how can i search from a particular post?

  4. Hi bro,
    Can i use both default search and this search at the same time? . Because i want to use default search for 1 custom post type and this plugin for the rest of custom post types

    1. Hi John, Well this is kind of feature request on which I am already working. Please open thread on forum so I can provide your solution for now.

  5. Hi there,

    i have been using your plugin and it works well. But now i am adding a multilingual features in the website and it is able to translate a taxonomy name into Vietnamese as well. For example: 'apple' into 'tao'.

    And so i tried to do a search to a certain taxonomy (in Vietnamese word, i.e.: 'tao'). It does not give me any result. But if i searched the English word ('apple'), only then it gave me the result. I was wondering if you can help me on this?



    1. Hi Frans,

      Sorry for the delay! I can see you've posted to forum as well. I will check and reply to you ASAP.