• Skip to primary navigation
  • Skip to content
  • Skip to footer

WordBits

WordPress Snippets | WordPress Plugin Generator

  • Browse Snippets
  • Submit A Snippet
  • Register
  • Log In

Unregister WordPress Post Types

Created by Metal Potato on September 3, 2018Tags: post type, unregister post type

Piece of code that I use regularly to unregister a WordPress post type. Just add/edit/remove the post type from lines 3, 4 and 5 and paste in your functions.php file.

Related

Download Plugin Zip View on GitHub

			
				<?php
function well_delete_post_type(){
    unregister_post_type( 'portfolio' );
    unregister_post_type( 'cms_block' );
    unregister_post_type( 'uncode_gallery' );    
    
}
add_action('init','well_delete_post_type');			
		

About Metal Potato

Metal Potato will help launch your website on-time, on-budget, on-message and en-route. Let's do launch!
https://metalpotato.com

Leave a Comment Cancel reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

WordBits

On This Site

  • Home
  • Snippets
  • Submit Snippet
  • Contact
  • Log In

Follow Us

  • Twitter
  • Home
  • Snippets
  • Submit Snippet
  • Contact
  • Log In

Copyright © 2019 · WordBits on Genesis Framework · WordPress · Log in