How to Make Confluence Read-Only
Platform notice: Server and Data Center only. This article only applies to Atlassian products on the Server and Data Center platforms.
Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.
*Except Fisheye and Crucible
Purpose
Having the option to make Confluence read-only can be very handy for administrators, especially when planning a migration/upgrade on a separate instance and planning to switch-over once testing has finished.
Solution
If you're running Confluence Data Center 6.10 or later, you can put your site into read-only mode, to limit what users can do. See Using read-only mode for site maintenance to find out how it works.
If you're running an earlier Confluence version, or have a Confluence Server license, one of the suggested workarounds listed below may work for your site.
Workarounds
If you are running Confluence Data Center 6.9 or earlier, or a Confluence Server (any version) you can apply one of the below workarounds.
Method 1
Revoke all space permissions from all the groups and users. This will prevent users from modifying content or adding comments.
This can be automated by using a third party solution, such as the Confluence CLI tool to remove the permissions across all spaces.
Method 2
This method works only with a Confluence Data Center license. It does not apply for Server license.
Apply an expired evaluation license to Confluence. This will allow all your users to access the instance, but an expired license will not allow any content to be changed and this also hides the top navigation bar containing all spaces hence please inform users about this as well. This is just a temporary workaround which is suitable for migrations and upgrades.
You must use an expired evaluation license that has an expiration date later than the release date of the Confluence version it's being applied to, otherwise the license will be considered invalid and cannot be applied. You can find Confluence versions and their build dates in the download archive.
Method 3 ( This works in DC too as tested so far with Confluence v8.5.x )
The least secure of all the methods, but rather easy to implement, is obscuring the options altogether.
To disable edit and create, navigate to Confluence Administration > Custom HTML, and under Look and Feel add the following to the end of BODY section (this will hide the create and edit button as well as the copy, move, and delete links site-wide for Confluence). This change is instantaneous and does not require a restart.
<script type='text/javascript'> AJS.$('#editPageLink').hide()</script> <script type='text/javascript'> AJS.$('#quick-create-page-button').hide()</script> <script type='text/javascript'> AJS.$('#create-page-button').hide()</script> <script type='text/javascript'> AJS.$('#action-copy-page-link').hide()</script> <script type='text/javascript'> AJS.$('#action-move-page-dialog-link').hide()</script> <script type='text/javascript'> AJS.$('#action-remove-content-link').hide()</script> <script type='text/javascript'> AJS.$('#header .aui-header .aui-button.aui-button-primary.aui-style').hide() </script>
To disable some page operation and commenting, navigate to Confluence Administration > Custom HTML, and under Look and Feel add the following to the end of BODY section. This change is instantaneous and does not require a restart.
- AJS.$('#comments-section').hide(); (this will hide the entire comment section site-wide for Confluence)
- AJS.$('#import-word-doc').hide(); (this will hide the import word document button site-wide for Confluence)
- AJS.$('#action-copy-page-link').hide(); (this will hide the copy page button site-wide for Confluence)
- AJS.$('#action-move-page-dialog-link').hide(); (this will hide the move page button site-wide for Confluence)
- AJS.$('#action-remove-content-link').hide(); (this will hide the delete page button site-wide for Confluence)
- AJS.$('#upload-div').hide(); (this will hide the upload attachment section in Attachment page site-wide for Confluence)
- AJS.$('.removeAttachmentLink').hide(); (this will hide the delete attachment button in Attachment page site-wide for Confluence)
-
<script type="text/javascript"> AJS.toInit(function(){ AJS.$('#comments-section').hide(); AJS.$('#import-word-doc').hide(); AJS.$('#action-copy-page-link').hide(); AJS.$('#action-move-page-dialog-link').hide(); AJS.$('#upload-div').hide(); AJS.$('.removeAttachmentLink').hide(); AJS.$('#action-remove-content-link').hide(); }); </script>
- To disable keyboard shortcuts for create and edit, go to Admin > Manage Add-ons. Expand the list to All Add-ons and search for Confluence Keyboard Shortcuts Plugin. Expand it and expand the modules, then disable each that you require, eg Create Page, Create Blog, Edit Page, Add Comment. If you are running Confluence 7.0 or a higher version, please follow the process in this document: Cannot enable or disable bundled system apps or modules
To hide the Update/Publish button (in case the user manages to access the page editor as per the note below), go to General Configuration, under Look and Feel click on Stylesheet then Edit, add the line below then save :
#savebar-container {display: none!important}
Please keep in mind that this only hides the options from pages. If users know the URL for editing pages etc, they may still be able to make changes.
To disable attachments upload, please refer to this KB article