Make WordPress Core

Opened 12 years ago

Closed 12 years ago

#20234 closed defect (bug) (duplicate)

'exclude_from_search' parameter for custom posts makes taxonomy archive pages return 0 posts

Reported by: egorpromo's profile egorpromo Owned by:
Milestone: Priority: normal
Severity: normal Version: 3.3.1
Component: Posts, Post Types Keywords:
Focuses: Cc:


I have custom posts 'manuals' and taxonomy 'manuals-category' for it.

add_action( 'init', 'create_manual_post_type' );
function create_manual_post_type()
			'label' => 'Manuals',
			'public' => TRUE,
			'rewrite' => array( 'slug' => 'manuals', 'with_front' => true),
			'has_archive' => true,
			'public' => true,
			'exclude_from_search' => TRUE, //This is for exclude my manuals when I make search for word 'wordpress' like ""

			'label'=>'Manual Category',
			'rewrite' => array( 'slug' => 'manuals-category', 'with_front' => true)



I want use 'exclude_from_search' parameter to prevent custom posts are visible when somebody searches keywords in my blog.
If I state 'exclude_from_search'=>TRUE my custom posts disappear on pages like{slug}.
{slug} is a term of 'manuals-category' taxonomy. Archive page opens but there are no posts in the Loop. When I state 'exclude_from_search'=>FALSE all is correct.

I suppose it is not documented behavior and bug.

Change History (1)

#1 @ocean90
12 years ago

  • Milestone Awaiting Review deleted
  • Resolution set to duplicate
  • Status changed from new to closed
Note: See TracTickets for help on using tickets.