Home > Back-end >  Wordpress: How to disable custom post type imported in a theme?
Wordpress: How to disable custom post type imported in a theme?

Time:11-23

I have installed Linoor theme which contains a post type called 'Events'. I want to implement the Events submission form for admin as well as visitors. The plugin Events Manager provides this facility for visitors to submit their events with admin approval. However, the plugin doesn't override the post type created by the theme. Also, in the admin side the 'Events' post type as duplicated fields for Event Address, location, timings, etc.

Is there a way to disable or remvoe this post type? Or hide/remove/disable the fields while creating a new event?

I looked up the theme and plugin's documentation but couldn't find the prooper way to solve this.

CodePudding user response:

you can use simply this code in functions.php

function remove_post_type(){
  unregister_post_type( 'events' );
}
add_action('init','remove_post_type', 100);

CodePudding user response:

You can use unregister_post_type with CPT's slug.

Reference: https://wordpress.stackexchange.com/questions/3820/deregister-custom-post-types

  • Related