WordPress provides an excellent option to generate user-required post types by introducing the custom post type feature. Generally, premium WordPress themes are bundled with various custom post types like portfolios, reviews, testimonials, teams, etc. However, you might not use them as a user, 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.

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

Please note that it is 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 upgrade of the theme.

, ,

Leave a Comment

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

*
*

Back To Top