How to exclude a custom post type from WordPress search

Here is how to exclude a custom post type from the WordPress search results. Handy if using custom post types for things like a slider on home page that aren’t meant to be a stand alone posts.

Instructions
Add the following code to your WordPress functions.php file.

Related links
http://codex.wordpress.org/Function_Reference/register_post_type

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *

Snippet Info

Tested with Wordpress v. NA

How to exclude a custom post type from WordPress search
4.5 (90%) 4 votes
Please report broken snippets.
Report Broken Snippet
SE Ranking