Hide the navigation and the header in modern SharePoint pages
Displaying a modern SharePoint page without the navigation and the header have generated all sort of hacks over the years that try to replicate the famous ?isDlg=1 and the focus mode from classic SharePoint by manipulating the DOM and injecting custom css.
I’ve recently discovered the query string that can be used with modern SharePoint site URLs to strip the pages from all its elements living it just with the content.
By adding the query string ?env=Embedded or ?env=WebView to any modern SharePoint URL (including lists) you will be automatically removing the navigation, header and footer form the page ending just with the content.
In the following animation you can see the differences between a normal and an embedded page.
If you want to preserve the suite bar in the page you can use the query string used by Microsoft Lists – ?env=WebViewList – this however will just work with pages, when added to a list it redirects the user to the Microsoft Lists application.
January 25, 2021
very nice info! thanks
January 25, 2021
bomb.com! Thank you!
January 25, 2021
This is great to know.
Thanks!
January 26, 2021
Great tip! Thank you!!
January 28, 2021
Awesome! Along SPFx solution, this is even cooler!
April 20, 2022
Great solution, but how we can make this permanent. because if users delete the URL backwards it will bring back the original page settings back?
Thanks
Atif
April 27, 2022
Hi Atif,
There is no easy and recommended way of doing this permanently.
The alternative would be creating a custom SPFx solution to remove all the elements, however this would not be persistent overtime as Microsoft continues to add more and more feature to SharePoint you would need also to update the solution.
This solution is more for you to integrate modern pages without the SharePoint artefacts in other applications like Microsoft Teams rather than sharing the page with the query string in the URL.
Hope this helps to clarify.
Have a nice day 🙂