How do I remove the side bar in Confluence?

Still need help?

The Atlassian Community is here for you.

Ask the community

Problem

Rather than removing the sidebar, it's recommended to hide the sidebar (or collapse it). Confluence provides methods for hiding the sidebar, which we can trigger via JavaScript.

The following methods are provided as is, and without warranty. They are proof of concepts only, and should not be relied upon - they may fail in newer versions of Confluence. Each method will also collapse the sidebar, regardless of the user's preference to the width of the sidebar. These methods may be annoying for users who prefer to have the sidebar open.

The appropriate JavaScript snippet must be added to the custom HTML of your site, at the end of the HEAD section.

Solution

For sites using the default theme:

Default Theme
<script>
AJS.toInit(function(){
  if (AJS.$("div.ia-fixed-sidebar").width() > 55){
    AJS.Confluence.Sidebar.toggle();
  }
});
</script>

For sites using the documentation theme:

Documentation Theme
<script>
  AJS.toInit(function(){
    AJS.$('#splitter-button').not('.collapsed').click();
  });
</script>

Alternatives:

  1. Each user can collapse the sidebar individually, and their preference will be remembered (via a cookie)
  2. Use the Documentation Theme instead, and collapse the page tree individually
  3. Look into adding a Marketplace app such as Adaptavist's Builder Theme or HideElements for Confluence, which will allow you to customise your own theme layout. Note: these apps are created by third-party developers and not managed by Atlassian.
Last modified on Sep 21, 2020

Was this helpful?

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