How to disable preview for any attached document in Confluence

Platform Notice: Data Center Only - This article only applies to Atlassian products on the Data Center platform.

Note that this KB was created for the Data Center version of the product. Data Center KBs for non-Data-Center-specific features may also work for Server versions of the product, however they have not been tested. 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

Summary

Confluence version above 7.2 does not allows to disable preview of attachments from UI.

If you have any specific reason where you don't want users to preview the file rather download the file, then the steps mentioned in this KB would be helpful. 

Solution

  • Go to the Confluence administration -> manage add ons -> show system add ons

  • Search for Confluence Previews and note the app key, mostly the app key should be com.atlassian.confluence.plugins.confluence-previews

  •  Log into DB and run the below query :

1 select BANDANAVALUE from BANDANA where BANDANAKEY = 'plugin.manager.state.Map';
  • The results would be a long list for example below :

  • Copy the complete list in a notepad and add the preview plugin key at the end of the file having the boolean value set to false just before /map.

1 2 3 4 <entry> <string>com.atlassian.confluence.plugins.confluence-previews</string> <boolean>false</boolean> </entry>
  • The complete set would be like below after adding the preview key:

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 <map> <entry> <string>com.atlassian.confluence.plugins.confluence-inline-tasks:task-email-notification-template-body</string> <boolean>true</boolean> </entry> <entry> <string>com.atlassian.confluence.plugins.confluence-content-notifications-plugin:blogpost-trashed-notification-template-body</string> <boolean>true</boolean> </entry> <entry> <string>com.atlassian.confluence.plugins.confluence-content-notifications-plugin:comment-created-notification-template-body</string> <boolean>true</boolean> </entry> <entry> <string>com.atlassian.confluence.plugins.confluence-content-notifications-plugin:page-trashed-notification-template-body</string> <boolean>true</boolean> </entry> <entry> <string>com.atlassian.confluence.plugins.confluence-content-notifications-plugin:blogpost-edited-hipchat-notification-template-body</string> <boolean>true</boolean> </entry> <entry> <string>com.atlassian.confluence.plugins.confluence-content-notifications-plugin:page-edited-hipchat-notification-template-body</string> <boolean>true</boolean> </entry> <entry> <string>com.atlassian.confluence.plugins.confluence-previews</string> <boolean>false</boolean> </entry> </map>
  • Next is to update the DB with the complete above set where you need to copy the complete data from your notepad and then run the below update query:

    1 update BANDANA set BANDANAVALUE = 'copy the entire text from <map> to </map>' where BANDANAKEY='plugin.manager.state.Map';
  • Once the table is updated, double check by running the select query to see if the table has been updated with the new data.

  • Stop and Start Confluence

  • After Confluence comes up, you can see in manage add ons that Confluence Preview plugin is disabled.

  • Test now with any excel or pdf file in Confluence and you should see that Preview of the file will not be happening and the file will directly download.

Updated on March 6, 2025

Still need help?

The Atlassian Community is here for you.