Generally, premium WordPress themes are bundled with custom post types like portfolios, reviews, testimonials, teams, etc. However, as a user, you might not be using them at all, eventually slowing down your website.

If you need to remove a custom post type you do not want to use anymore, use the following lines of code. WordPress will automatically unregister those particular post types from the site admin dashboard. Please note that it is a best practice to create a child theme to add any custom code for the WordPress themes. Otherwise, you might lose all of the changes during the upgradation of the theme.

if( !function_exists( 'bluewindlab_unregister_post_type' ) ) {
    function bluewindlab_unregister_post_type(){
        unregister_post_type( 'portfolio' );
    }
}
add_action('init','bluewindlab_unregister_post_type');

Leave a Comment

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

*
*

Back To Top