I have a SharePoint Online page created with a template, which I cannot remove the left navigation pane from. (I can edit the list of links, but I want to remove the whole pane completely).

Ideally I would like to remove the left navigation panel from this page only. Not from the entire site.

Please suggest any workaround...

2 Answers 2


If you are using a modern SharePoint site, you can disable the Quick Launch by going to Site Settings > Navigation elements (under "Look and Feel") > Untick "Enable Quick Launch".

More information can be found in the article below, in the section "Turn the left-hand menu on or off for a SharePoint team site":



You could add js code to determine whether the page is the target page.If it is,then add the custom css(Use CSS to hide left navigation).


if ((window.location.href.toLowerCase().indexOf('testfolder') > 0))
        var head = document.getElementsByTagName('head')[0];
        var link = document.createElement('link');
        link.href = 'https://contoso.sharepoint.com/sites/dev/Doc/testFolder/test.css';
        link.rel = 'stylesheet';
        link.type = 'text/css';

Inserting this code needs to distinguish different types of pages:

  1. Modern page:you need to use SPFX Extension to add JS file.
  2. Classic page:you could add this file to global jslink.

pnp powershell:

$username = "[email protected]"
$password = "Password"
$cred = New-Object -TypeName System.Management.Automation.PSCredential -argumentlist $userName, $(convertto-securestring $Password -asplaintext -force)
Connect-PnPOnline -Url https://contoso.sharepoint.com/sites/dev -Credentials $cred
 Add-PnPJavaScriptLink -Name "JSLoadAfterSP" -Url /sites/dev/Doc/testFolder/test.js -Sequence 9999 -Scope Site

Similar issue:

How to use JS to inject CSS for specific system pages


SPFX Extension add js file:



Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.