How to Make Confluence Read-Only

Still need help?

The Atlassian Community is here for you.

Ask the community

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

The least secure of all the methods, but rather easy to implement, is obscuring the options altogether.

  1. 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>
  2. 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.

    1. AJS.$('#comments-section').hide(); (this will hide the entire comment section site-wide for Confluence)
    2. AJS.$('#import-word-doc').hide(); (this will hide the import word document button site-wide for Confluence)
    3. AJS.$('#action-copy-page-link').hide(); (this will hide the copy page button site-wide for Confluence)
    4. AJS.$('#action-move-page-dialog-link').hide(); (this will hide the move page button site-wide for Confluence)
    5. AJS.$('#action-remove-content-link').hide(); (this will hide the delete page button site-wide for Confluence)
    6. AJS.$('#upload-div').hide(); (this will hide the upload attachment section in Attachment page site-wide for Confluence)
    7. AJS.$('.removeAttachmentLink').hide(); (this will hide the delete attachment button in Attachment page site-wide for Confluence)
  3. <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>
  4. 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
  5. 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

DescriptionHaving 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.
ProductConfluence
PlatformServer
Last modified on Sep 5, 2023

Was this helpful?

Yes
No
Provide feedback about this article
Powered by Confluence and Scroll Viewport.