I'm trying to wrap my head around the new sidebar api vs metabox issue when trying to come up with how to save metadata for a custom post type. I've got a couple websites I'm going to be creating that will use multiple custom post types that I will be creating: Events, FAQ, Enrollments, Sponsors, to name a few.

I had gotten understanding how to make CPTs and create metaboxes to save metadata not long before wordpress released 5.0 and Gutenberg. I have read about how metaboxes are on their way to obsolescence and that creating sidebars are the way of the future for saving metadata.

A couple questions for best practices:

  1. Should I be using the sidebar or metaboxes
  2. If sidebar, should I be putting the metadata inputs in the default sidebar or making a custom sidebar?
  3. If I should be doing a custom sidebar, is there a way to make that be the default sidebar displayed?

Update 12/30/19 I found this post which mentions a link to the Block editor handbook about block templates. It appears that I should be able to make a series of custom block types to accept meta data within this block template for that custom post type and lock down the block template with the template_lock property. Is this a better approach than using the sidebar for inputting metadata?

Your Answer

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

Browse other questions tagged or ask your own question.