Hide Divi's Projects Post Type
Hides the Projects post type that Divi adds, from the admin menu, menus, search and the front end, for sites that never use it.
Opens WPIDE on
Code
add_filter( 'et_project_posttype_args', function ( $args ) {
$args['public'] = false;
$args['publicly_queryable'] = false;
$args['show_ui'] = false;
$args['show_in_menu'] = false;
$args['show_in_nav_menus'] = false;
$args['show_in_admin_bar'] = false;
$args['exclude_from_search'] = true;
$args['has_archive'] = false;
return $args;
} );
Notes
Existing projects are kept in the database and come back if you remove this snippet.
How to add this snippet
- Install WPIDE on your WordPress site (it is free) and open Code Snippets.
- Use snippet above adds it from the library in one click. Or copy the code into a new snippet with the same code type.
- It is added inactive: review the code and settings, then switch it on.