Search code examples
wordpresswordpress-rest-apiwordpress-gutenberg

Disable "stick to the top of the blog" and "pending review" in Gutenberg sidebar


Recent versions of Wordpress - possibly since version 5.8 - have these new options in the Post sidebar:

enter image description here

"Stick to the top of the blog" and "pending review" in particular are unnecessary for my sites, taking up unnecessary space and, most importantly, mental clutter in the eyes of clients and end users.

Is there a way to disable them, or failing that, just hide them?


Solution

  • Because the other elements have direct classes, I used a :not css statement (couldn't find a real programmatic solution)

    .components-panel .edit-post-post-status > .components-panel__row:not(
      .edit-post-post-visibility, 
      .edit-post-post-schedule, 
      .edit-post-post-author, 
      :last-child) {
      display: none;
    }
    

    Every panel that has to be shown needs to be included in the ONE :not-statement, if separated to single listeners they would cannibalize themselves. The 'last-child' is the trash button, that has also not its own classname.