I have a Custom Post Type called "cities".

Each city has: Name, Population, Coordinates and so forth. I don't want users to be able to add their custom content there (using wp-content editor, HTML or the Visual one).

What's the best approach to this? Should I hide the text editor in CSS and then place (around 30) metaboxes on each page? Would 30 metaboxes hit theme's performance hard compared to normal posts? I'm aiming for tens of thousands of posts, 30 metaboxes each. Any hints?


1 Answer 1


To create a custom post type without the editor, simply omit 'editor' in the 'supports' argument when you register the custom post type:

$args = array(
    // only title field will be visible
    'supports' => array( 'title' ),
    // other args here...
register_post_type( 'cities', $args );

As for your meta data, that is a lot, but I wouldn't say it's too much. And you don't need to create 30 meta boxes for 30 pieces of data, you can render all of the fields in a single meta box.

Think about how you'll need to use that data later- If you need to query and sort on the data via a meta_query, then it should be its own field. But if there's data that will only be displayed but not queried on, you can save that all as an array under a single key:

$data = array(
    'street' => 'fake street',
    'number' => 123,
    'fruit' => 'pears'
update_post_meta( $post_id, 'some_data', $data );

WordPress will take care of converting the array to a storable value, and converting it back to an array when the data is loaded.

  • 1
    +1. But from a UI perspective, it would be better to register custom meta boxes for the CPT-specific custom meta-data. Oct 28, 2013 at 16:30
  • @ChipBennett, do you mean adding 30 different metaboxes using add_meta_box() to my CPT edit page? Or maybe using Metadata API, if so could you explain more? I've never used custom meta-data before. Oct 28, 2013 at 17:48
  • Yes, I mean using add_meta_box() to add your meta data. Oct 28, 2013 at 17:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.