add_action( 'init', 'exclude_from_search' ); function exclude_from_search() { global $wp_post_types; /* Exclude 'page' post type. */ $wp_post_types['page']->exclude_from_search = true; /* Exclude 'attachment' post type. */ $wp_post_types['attachment']->exclude_from_search = true; }

By continuing to use the site, you agree to the use of cookies. Click here for more information

The cookie settings on this website are set to "allow cookies" to give you the best browsing experience possible. If you continue to use this website without changing your cookie settings or you click "Accept" below then you are consenting to this. You can change your settings at any time.