Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8929949
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T08:46:49+00:00 2026-06-15T08:46:49+00:00

I have created a custom post type ‘hotel’ and custom ‘taxonomy’ so when administrator

  • 0

I have created a custom post type ‘hotel’ and custom ‘taxonomy’ so when administrator creates a new hotel and saves it it related custom taxonomy automatically get created but I don’t want to show custom metabox in the admin side hotel edit page so for that I used WordPress function but nothing happen.


My custom post code

$Hotel_labels = array(
    'name' => _x('Hotels', 'post type general name'),
    'singular_name' => _x('Hotel', 'post type singular name'),
    'add_new' => _x('Add New', 'Hotel'),
    'add_new_item' => __('Add Hotel'),
    'edit_item' => __('Edit Hotel'),
    'new_item' => __('New Hotel'),
    'all_items' => __('All Hotels'),
    'view_item' => __('View Hotel'),
    'search_items' => __('Search Hotel'),
    'not_found' =>  __('No Hotel found'),
    'not_found_in_trash' => __('No Hotel found in Trash'), 
    'parent_item_colon' => '',
    'menu_name' => __('Hotel'),
);



$Hotel_args = array(
    'labels' => $Hotel_labels,
    'public' => true,
    'rewrite' => array('slug' => 'Hotel'),
    'publicly_queryable' => true,
    'show_ui' => true, 
    'show_in_menu' => true, 
    'query_var' => true,
    'rewrite' => true,
    'capability_type' => 'post',
    'has_archive' => true, 
    'hierarchical' => false,
    'menu_position' => 100,
    'supports' => array( 'title', 'editor', 'author', 'thumbnail' ),
    'taxonomies' => array('hotel_facilities','package_hotel','post_tag')
);

register_post_type('Hotel',$Hotel_args);

Custom taxonomy code

$Package_labels = array(
    'name' => _x( 'Package Hotels', 'taxonomy general name' ),
    'singular_name' => _x( 'hotel', 'taxonomy singular name' ),
    'search_items' =>  __( 'Search hotels' ),
    'popular_items' => __( 'Popular hotels' ),
    'all_items' => __( 'All hotels' ),
    'parent_item' => null,
    'parent_item_colon' => null,
    'edit_item' => __( 'Edit hotel' ), 
    'update_item' => __( 'Update hotel' ),
    'add_new_item' => __( 'Add New hotel' ),
    'new_item_name' => __( 'New hotel Name' ),
    'separate_items_with_commas' => __( 'Separate hotels with commas' ),
    'add_or_remove_items' => __( 'Add or remove hotels' ),
    'choose_from_most_used' => __( 'Choose from the most used hotels' ),
    'menu_name' => __( 'Package Hotels' ),
);

register_taxonomy('package_hotel','package',array(
    'hierarchical' => false,
    'labels' => $Package_labels,
    'show_ui' => true,
    'update_count_callback' => '_update_post_term_count',
    'query_var' => true,
    'show_in_nav_menus' => false,
    'rewrite' => array( 'slug' => 'hotels' ),
));

code to remove custom taxonomy metabox form custom post type hotel page

function my_remove_meta_boxes() {
    remove_meta_box('tagsdiv_hotels', 'Hotel', 'side');
}

add_action( 'admin_menu', 'my_remove_meta_boxes' );
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T08:46:50+00:00Added an answer on June 15, 2026 at 8:46 am

    Change register_taxonomy() : you have kept

    'show_ui' => true,
    

    change it to

    'show_ui' => false,
    

    this argument determines whether or not a user interface should be displayed to manage the taxonomy. As you don’t want it, you have to set it to false.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have created a custom post type named People. I have created a page
i have created a custom post type named Books & i have a widget
I have created a custom post type of 'portfolio' and page with a template
I have created a custom post type called banners and want to enable the
I have created a custom post type with an image gallery upload. Now I
I have created a custom post type calles articles and a custom category like
I've created a custom post type and a custom taxonomy to go with it.
I have created a custom post type for my portfolio page. I have two
I'm a newbie in WordPress. I have created a custom post type called arts
I'm a newbie in WordPress. I have created a custom post type for videos

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.