Why and how to hide Publish Site buttons in Sitecore?
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 siteitem,
- deny the Read permission from the
sitecore > content > applications > content editor > menues > publish siteitem.
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.
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.