Spesso quando si lavora con dei temi pre-confezionati per sviluppare un nuovo sito web basato su wordpress, ci troviamo tanti custom post type inutili per il nostro progetto. Per deregistrarli potete usare questo piccolo codice che va inserito nel file functions.php del tema figlio.
function studio42_unregister_cpt() { global $wp_post_types; foreach( array( 'nome-singolo-post-type-1', 'nome-singolo-post-type-2', 'nome-singolo-post-type-3' ) as $post_type ) { if ( isset( $wp_post_types[ $post_type ] ) ) { unset( $wp_post_types[ $post_type ] ); } } } add_action( 'init', 'studio42_unregister_cpt', 20 );