WordPress.org

Ready to get started?Download WordPress

Forums

Exclude from search (1 post)

  1. jasonsweb
    Member
    Posted 1 year ago #

    Hi,

    I've created a new custom post type, and set the value of "exclude_from_search" to true. But when I search on my website, it still returns the custom post type results.

    This is a part of the code:

    $args = array(
       'labels' => $labels,
       'public' => true,
       'exlude_from_search' => true,
       'show_in_menu' => true,
       'supports' => array('title', 'editor', 'thumbnail')
    );
    
    register_post_type('testimonials', $args);

    What am I doing wrong?
    Thanks in advance!

Topic Closed

This topic has been closed to new replies.

About this Topic