WordPress.org

Forums

CM Tooltip Glossary
[resolved] How to exclude results from search? (3 posts)

  1. peter-a
    Member
    Posted 1 year ago #

    I want to exclude the entire glossary from WordPress search results. How can I do that?

    I'm using the free version and WP 3.6.1.

    http://wordpress.org/plugins/enhanced-tooltipglossary/

  2. peter-a
    Member
    Posted 1 year ago #

    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.

  3. bendm
    Member
    Posted 8 months ago #

    Thanks for this. Worked for me

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic