🎉 Discount Alert! Get 50% OFF your BWL Advanced FAQ Manager license renewal or new purchase - Offer Ends Soon!

WordPress is one of the most powerful CMS in the web industry, and it contains a huge amount of code with lots of different functions. On top of that, WordPress uses PHP for it’s core language.

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
Premium WordPress Themes and Plugins By xenioushk
Privacy Overview

This website uses cookies so that we can provide you with the best user experience possible. Cookie information is stored in your browser and performs functions such as recognising you when you return to our website and helping our team to understand which sections of the website you find most interesting and useful.