Unregister a Post type using unregister_post_type()

Unregister a post type using unregister_post_type

Unregistering a post type is a serious issue for child theme developers. Because parent theme contains some unwanted post types and that lead to some confusions for clients. WordPress 4.5 solves this problem. It includes a function for unregister a post type – unregister_post_type().

unregister_post_type() unregister unwanted post types. But it doesn’t unregister built in post types post , page attachment, revision etc.

Example

This will delete post type with name ‘blocks’.

unregister_post_type() – Source

Happy Coding..

Leave a Reply

1 Comment

  1. These is nice information, I really appreciate content, which is cover over here, Fantastic.

    Thank You

Next ArticleWebsites To Find Free stock images