Hide Return to Classic SharePoint link in SharePoint

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.

Switching between Classic and Modern Sharepoint

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:

Hide/Show Return to classic SharePoint Link Using PowerShell

Follow these steps to hide or show the Return to classic SharePoint link.

  1. 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.

  1. Disable “Return to classic SharePoint” link:
Set-SPOTenant -DisableBackToClassic=True
Hide Return to classic SharePoint Link Using SharePoint Online PowerShell
  1. When you go to the SharePoint library, you can’t see the “Return to classic SharePoint” link.
How To hide Return To Classic SharePoint
  1. 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.

  1. Install/Update PnP PowerShell Module:
Install-Module -Name PnP.PowerShell -Force -AllowClobber
Update-Module -Name PnP.PowerShell
  1. 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.

  1. Disable Return to classic SharePoint link:
Set-PnPTenant -DisableBackToClassic $true
  1. If you want to enable it back:
Set-PnPTenant -DisableBackToClassic $false
Disable or hide Return to classic in Sharepoint
  1. With these commands, you can enable the Return to classic SharePoint option using PnP PowerShell.
Enable Return to Classic SharePoint link in SharePoint Online

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:

Power Apps functions free pdf

30 Power Apps Functions

This free guide walks you through the 30 most-used Power Apps functions with real business examples, exact syntax, and results you can see.

Download User registration canvas app

DOWNLOAD USER REGISTRATION POWER APPS CANVAS APP

Download a fully functional Power Apps Canvas App (with Power Automate): User Registration App