You can hide any system web item or panel, including ones provided by plugins, using the Hide UI Element built-in script. The script allows you to add additional conditions to the UI elements to control when they are displayed. Led by the examples below, you can:

Don’t confuse your users. If you are removing a menu item, make sure you document it and explain to your users why it’s not available.

This script only hides the web item. If your users know the URL that is invoked, they can still do the action. This script reduces clutter and allows users to focus on the more important parts of the UI.

You can see all the hidden items by navigating to Administration > Script Fragments. Additionally, disabling ScriptRunner restores anything that is hidden. Before raising a ticket about a missing item, please check the hidden items to ensure this script is not the reason.

Examples

Hide Export to PDF Item

You can disable the Export to PDF and Export to Word options for pages in one project.

  1. Go to Admin > Fragments.

  2. Select Hide System or Plugin UI Element.

  3. Fill out the form:

    hide export to pdf
    You will not always know the key of the item you wish to ask. Start typing some characters in the name, and use trial and error.

    These operations are only be visible in the two spaces listed because of the conditions used. If you want to hide it in just one or two spaces, remove the condition. In the following code example, the condition means the option is visible in all spaces except SPD:

    ! (context.space?.key in ["SPD"])

    For more inforamation, the section on conditions on the _Web Items page is relevant here.

This image shows the page before and after using the Hide UI Element.

hidden menu items
You can only further restrict the provided conditions. For example, the Export operation requires that the current user has View page permissions in the current space. If the user does not have those permissions, it won’t be displayed regardless of any condition you configure.

Hide Social Features

Similar to the previous example, you can disable the social features for pages in one project.

  1. Go to Admin > Fragments.

  2. Select Hide System or Plugin UI Element.

  3. Fill out the form:

    hide social features

    The Like/Dislike buttons are not web items, but you can prevent Confluence from loading the relevant JavaScript by running the following script in the Script Console:

    +

    import com.atlassian.plugin.PluginController
    import com.atlassian.sal.api.component.ComponentLocator
    
    def pluginController = ComponentLocator.getComponent(PluginController)
    pluginController.disablePluginModule("com.atlassian.confluence.plugins.confluence-like:content-like-resources")
    pluginController.disablePluginModule("com.atlassian.confluence.plugins.confluence-like:mobile-content-like-resource")
    The Follow link remains in the user-hover inline dialog. The only way to remove it is by editing ./confluence/users/userpopup.vm.

Have questions? Visit the Atlassian Community to connect, share, and learn with other Atlassian users and experts, including Adaptavist staff.

Ask a question about ScriptRunner for JIRA, Bitbucket Server, or Confluence.

Want to learn more? Check out courses on Adaptavist Learn, an online platform to onboard and train new users for Atlassian solutions.