Skip to content

MetaBoxesMain renders empty "Meta Boxes" panel when there are only sidebar metaboxes #84173

Open

Description

@andfinally

Description

Our site only has a couple of metaboxes registered to "side".

wp.data.select('core/edit-post').getActiveMetaBoxLocations()

// returns

[ "side" ]

wp.data.select('core/edit-post').getAllMetaBoxes()

// returns

[
  {
    "id": "ef_editorial_meta",
    "title": "Editorial Metadata"
  },
  {
    "id": "mdt-review",
    "title": "Review"
  }
]

MetaBoxesMain decides visibility based on whether metaboxes are registered for normal, advanced or side:

isMetaBoxLocationVisible2("normal") || isMetaBoxLocationVisible2("advanced") || isMetaBoxLocationVisible2("side")

But the panel body only renders normal and advanced metaboxes:

<MetaBoxes location="normal" />
<MetaBoxes location="advanced" />

side metaboxes are rendered separately in the Editor component.

If the only registered boxes sit in the side location, we get the "Meta Boxes" toggle bar and a drag handle with nothing inside it.

This looks broken. We should remove side from the visbility condition.

Step-by-step reproduction instructions

  1. Have a site with at only one metabox registered in side.
  2. Go to wp-admin/edit.php and edit a post.
  3. Note the empty "Meta Boxes" panel at the bottom of the editor.

Screenshots, screen recording, code snippet

Image

Environment info

  • WordPress 7.1.
  • Gutenberg 23.6.

Please confirm that you have searched existing issues in the repo.

  • Yes

Please confirm that you have tested with all plugins deactivated except Gutenberg.

  • Yes

Please confirm which theme type you used for testing.

  • Block
  • Classic
  • Hybrid (e.g. classic with theme.json)
  • Not sure

Activity

  1. added
    [Type] BugAn existing feature does not function as intended
    on Oct 7, 2026
  2. t-hamano commented on Oct 8, 2026

    @t-hamano
    Contributor

    Thanks for the report.

    If the only registered boxes sit in the side location, we get the "Meta Boxes" toggle bar and a drag handle with nothing inside it.
    This looks broken. We should remove side from the visbility condition.

    Unfortunately, the situation is not that simple. Metaboxes can be moved between the main area and the sidebar. This feature is disabled if the empty main metabox is not rendered.

    This is untested, but we might be able to check if the main metabox is empty and set its height to zero if so.

  3. andfinally commented on Oct 8, 2026

    @andfinally
    Author

    Thanks @t-hamano, I didn't think of that!

    FWIW, in my version of the editor, I'm not able to drag the metaboxes out of the sidebar to that panel. And when a metabox is at the bottom of the sidebar, the down arrow is greyed out. So there must be some conditions involved in their positioning.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    [Feature] Meta BoxesA draggable box shown on the post editing screen[Status] In ProgressTracking issues with work in progress[Type] BugAn existing feature does not function as intended

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions