WordPress.org

Support

Support » Plugins and Hacks » [Resolved] How to exclude results from search?

[Resolved] How to exclude results from search?

Viewing 2 replies - 1 through 2 (of 2 total)
  • OK, I managed to find the answer on wp-snippets.com:

    Add this code to your functions.php file:

    // Exclude glossary from search results
    add_action('init', 'codex_custom_init');
    function codex_custom_init()
    {
    
      $args = array(
        'exclude_from_search' => true, // the important line here!
      );
      register_post_type('glossary',$args);
    }
    
    // END Exclude glossary from search results

    Voilá, the glossary is excluded from search results.

    Thanks for this. Worked for me

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘[Resolved] How to exclude results from search?’ is closed to new replies.