How to hide labels in Confluence page using JavaScript in Specific Spaces

Still need help?

The Atlassian Community is here for you.

Ask the community

This guide is for informational purposes and is not eligible for support from Atlassian.  If you have any questions about the information on this page, please reach out to our community at Atlassian Answers for help. 

Purpose

To hide labels displayed in Confluence page of specific spaces using JavaScript.

Solution

  1. Find out the space key for the spaces in interest by going to Space Tools > Overview. 
  2. Navigate to Confluence Admin >> Custom HTML
  3. Click Edit
  4. Add the following to At the end of the HEAD:

<script type="text/javascript">
    AJS.toInit(function(){
        if (AJS.$('meta[name=confluence-space-key]').attr("content")== '<space_key>'){
          AJS.$('#labels-section').hide();
        }
    });
</script>

(info) Replace the <space_key> above with the actual space key obtained from step 1

Last modified on Aug 9, 2016

Was this helpful?

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