How do I remove the sidebar in Confluence?
Problem
Rather than completely removing the sidebar, it's recommended that you hide it (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.
Therefore, we recommend trying these methods in a non-production environment first in order to make sure they work correctly, to only then apply the same solution in production.
Solutions
For individual users:
Each user can open and collapse the sidebar using the keyboard shortcut "[" or dragging the following button to the left or to the right in order to adjust the sidebar width or collapse it:
This user preference is saved into a web browser cookie for the preference to be remembered later. So, if you collapse it and come back later, it will remain collapsed.
For all users:
The theme must be edited to collapse the sidebar for all users. This solution takes precedence over the individual user solution mentioned above, so individual users won't have this preference persisted in a browser cookie. This approach may be annoying for users who prefer to have the sidebar open.
You may be using the default theme bundled with Confluence or using a custom theme provided by a third-party app.
When using the Confluence Default Theme:
- Go to
Confluence Administration > Look and Feel > Custom HTML
- Click the
Edit
button Add the following JavaScript snippet to the At end of the HEAD text area:
<script> AJS.toInit(function(){ if (AJS.$("div.ia-fixed-sidebar").width() > 55){ AJS.Confluence.Sidebar.toggle(); } }); </script>
- Click the
Save
button
When using a theme provided by third-party apps
Apps such as ThemeBuilder for Confluence and HideElements for Confluence allow you to customize your own theme layout.
These apps are created and maintained by third-party vendors and, therefore, are not supported by Atlassian.
Contact the third-party app vendor in order to ask them if their app allows hiding the sidebar and, if so, how to do it.