Recently, I was working on a Document Management System for one of my clients. While creating several libraries in their SharePoint Online site, I noticed something interesting: at the bottom of every modern library view, there was a Return to classic SharePoint link.

Now, since my client is not very familiar with SharePoint, they prefer using only the modern experience. But sometimes, by mistake, they would click on this link and suddenly switch to the classic experience, and they had no idea how they landed there. This was creating a lot of confusion.
To avoid such situations, I decided to hide the Return to classic SharePoint link in the library. And in this tutorial, I will show you how you can hide or show this link in SharePoint Online using two different methods:
- Using SharePoint Online PowerShell
- Using PnP PowerShell
Hide/Show Return to classic SharePoint Link Using PowerShell
Follow these steps to hide or show the Return to classic SharePoint link.
- Open PowerShell in Administrator mode and run the following to connect to the SharePoint Online Admin Center:
Connect-SPOService -Url https://<YourTenant>-admin.sharepoint.com
Note: Replace <YourTenant> with your actual tenant name.
- Disable “Return to classic SharePoint” link:
Set-SPOTenant -DisableBackToClassic=True

- When you go to the SharePoint library, you can’t see the “Return to classic SharePoint” link.

- If you want to enable it back:
Set-SPOTenant -DisableBackToClassic=False
To follow the above steps, you can now disable or re-enable the link using SharePoint Online PowerShell.
Hide/Show Return to classic SharePoint Link Using PnP PowerShell
Another way is by using PnP PowerShell, which is more modern and widely used.
- Install/Update PnP PowerShell Module:
Install-Module -Name PnP.PowerShell -Force -AllowClobber
Update-Module -Name PnP.PowerShell
- Then, Connect to the SharePoint Admin Center:
Connect-PnPOnline -Url "https://<YourTenant>-admin.sharepoint.com" -ClientId "Your Client Id" -Interactive
Note: If you don’t know your Client Id, you need to register an Azure AD app and grant it permissions to connect with SharePoint.
- Disable Return to classic SharePoint link:
Set-PnPTenant -DisableBackToClassic $true
- If you want to enable it back:
Set-PnPTenant -DisableBackToClassic $false

- With these commands, you can enable the Return to classic SharePoint option using PnP PowerShell.

In this tutorial, I explained how to show and hide the Return to Classic SharePoint link in SharePoint Online.
You may also like the following tutorials:
- Write to a File Line by Line in PowerShell
- Create Sensitivity Labels in Microsoft 365
- PowerShell Find All Files With Extension
- Write to a File without a Carriage Return in PowerShell
- Find Files Older Than a Specific Date using PowerShell
- Block Download Of Documents in SharePoint & OneDrive

Hey! I’m Bijay Kumar, founder of SPGuides.com and a Microsoft Business Applications MVP (Power Automate, Power Apps). I launched this site in 2020 because I truly enjoy working with SharePoint, Power Platform, and SharePoint Framework (SPFx), and wanted to share that passion through step-by-step tutorials, guides, and training videos. My mission is to help you learn these technologies so you can utilize SharePoint, enhance productivity, and potentially build business solutions along the way.