• Resolved muclbahaloute

    (@muclbahaloute)


    Hello everyone,
    A hopefully straightforward problem to solve – is there a way to hide downloads from the search results page? By default they appear over there and I’d basically like to exclude them from search. Thanks in advance for the help.

Viewing 1 replies (of 1 total)
  • Thread Starter muclbahaloute

    (@muclbahaloute)

    Solved. If anyone is interested the following does the trick:

    
    add_action( 'init', 'update_download_post_type', 99 );
    function update_download_post_type() {
    	global $wp_post_types;
    	if (post_type_exists('download')) {
    		$wp_post_types['download']->exclude_from_search = true;
    	}
    }
    
Viewing 1 replies (of 1 total)
  • The topic ‘Hide downloads from search results page’ is closed to new replies.