How to disable “Return to Classic SharePoint” in SharePoint Online?
In modern SharePoint Online sites, You’ll find the link “Return to Classic SharePoint” in the bottom-left corner below quick launch – for backward compatibility. On clicking, the link reverts the current list or library to classic mode. Similarly, On the classic UI, there’s a corresponding link, “Exit classic experience.” Looking to remove the “return to classic SharePoint” button in SharePoint Online but don’t know how? Discover how to make the switch seamlessly with this guide!
SharePoint Online: Remove return to classic SharePoint option
You may want to disable the “Return to Classic SharePoint” link or hide it from the left navigation menu of modern SharePoint sites to prevent users from having the ability to switch between the two experiences. Here is the PowerShell script to disable the return to classic SharePoint.
#Connect to SharePoint Online
Connect-SPOService -Url https://Crescent-Admin.sharepoint.com
#Disable "Return to Classic SharePoint"
Set-SPOTenant -DisableBackToClassic $True
This applies at the tenant level; running the above script will remove the “Return to classic SharePoint” option for all sites across the tenant.
Enable Return to classic link in SharePoint Online
What if the “Return to classic SharePoint” is missing in SharePoint Online, and you want to bring it back? To show the link again, run the following PowerShell cmdlet:
#Enable "Return to Classic SharePoint"
Set-SPOTenant -DisableBackToClassic $False
It takes a while to propagate this change to all sites in the tenant. The same applies when the “Exit classic experience” is missing!
Remove return to classic SharePoint option using CSS
You can also hide return to the classic SharePoint option with CSS:
.LeftNav-subLinks a {
Display: none;
}
Set-SPOTenant : A parameter cannot be found that matches parameter name ‘DisableBackToClassic’
Perhaps not working anymore 🙁
Thank you
P.
Looks like your SharePoint Online PowerShell Module is not updated! How to Update SharePoint Online PowerShell Module?
Lists don’t have “edit page” option. So the Modern Script editor web-part can’t be added to the list page and therefore css method can’t be used to hide “Return to Classic SharePoint” on the modern list? Is this correct or am I missing something? Thanks
Inject a CSS at site level with SPFx application customizer! How to Add Custom CSS to Modern SharePoint Online Site?
Where do you set the css?
CSS on modern SharePoint Online sites can be injected either with Modern Script editor web part or using SPFx Application Customizer. Refer: