WordPress.org

Ready to get started?Download WordPress

Forums

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

  1. peter-a
    Member
    Posted 6 months 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 6 months 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.

Reply

You must log in to post.

About this Plugin

About this Topic