Why and how to hide Publish Site buttons in Sitecore?


sitecore hide publish site button

Have you ever experienced what can happen when one of your Sitecore users published the entire site accidentally instead of publishing only one chosen item? This can cause huge problems if there are some items located in a content tree that should not be published yet (or at all), or if the number of items in a content tree is so huge that your entire server becomes unresponsive when a site is being published.

In the real life development of Sitecore sites, the usage of the Publish Site command ends with a site going live in most cases. It is frequently used during the development phase but after a site is ready for end users, only in some rare situations do Sitecore administrators publish an entire site again.

This is why it’s a good idea to consider hiding the Publish Site buttons for all users except the administrator. It’s very easy with Sitecore access rights. In a typical Sitecore installation, there are 2 Publish Site buttons:

  • in the ribbon within the ‘Publish’ chunk in the ‘Publish’ menu,
  • in the Sitecore start menu.

In order to hide them, you need to switch the database to Core, run the Security Editor application, select the role sitecore\Sitecore Client Publishing and:

  • remove the Read permission from the sitecore > content > document and settings > all users > start menu > left > publish site item,
  • deny the Read permission from the sitecore > content > applications > content editor > menues > publish site item.

The image below shows how the access rights should be set in order to hide the Publish Site buttons for all the users except for the admin.


sitecore hide publish site button in security editor

Sitecore Security Editor – setting user access permission

It will take you no longer than five minutes. Setting the access rights is very easy with Sitecore Security Editor and worth the effort for the peace of mind that comes from knowing that your users can’t publish content which is not approved yet, or threaten the stability of your live site.

If you found this post interesting, then do check out my other Sitecore posts.

  • Doug

    Hi Marek,

    While I agree with your suggestion of hiding the Publish buttons for content authors, I don’t agree with your approach. I don’t think it’s a good idea to modify the core roles that come with a Sitecore installation, in this case, Sitecore Client Publishing. If you modify the Sitecore Client Publishing role and later on need to give a content author access to the Publish Site button, you will be forced to make them admins.

    The better approach, in my opinion, is to simply not assign that role to content authors. The only roles content authors need are Sitecore Client Users and Sitecore Client Authoring. In addition, I would recommend the most basic of workflows, for example, the Sample Workflow that comes with every Sitecore installation out-of-the-box. Without having the Sitecore Client Publishing role and with Workflow enabled, content authors would need to use the Workflow buttons to push content live.

    Thanks,
    Doug

    • Mark G.

      The other reason that it is better to not modify built-in groups is for upgrade support. Sitecore doesn’t recommend that you modify the built-in items because Sitecore may modify them in a future release.

      • Marek Musielak

        Doug, Mark, thank you for your comments.

        You’re absolutely right about the workflow approach – that’s the proper way of restricting the access rights and preventing random publishing by the authors.
        The scenario I mentioned is the real live example which I heard from a project manager from another company and the ‘Publish Site’ button was used there by one of the developers unintentionally causing some troubles.

        And in that case they claimed that the publishing workflow approach would be to expensive to introduce as the site was running for a couple of years already.

        • Kam J

          Sure, workflow might be, but re-assigning user permissions to the correct roles is very simple and out of the box Sitecore functionality.

  • Pingback: Content Authors and Publishing Permissions | Let's do Sitecore

  • Craig

    Ever experience a time when someone publishes an item but it ends up publishing from the root item? The mouse hover shows Publish Item. But the logs show it’s starting at the root. It’s very troublesome.

    • Marek Musielak

      Never experienced such a problem. I always double check whether the correct item is chosen and the rhs panel shows its properties.