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.

Focus on SharePoint content

?env=Embedded is the new ?isDlg=1

By adding the query string ?env=Embedded 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.

Embed a SharePoint page

Note: Despite being included in the Microsoft JS files the query string is not documented which means that it is not officially supported.

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.

Embed a SharePoint page


5 Responses to “Hide the navigation and the header in modern SharePoint pages”

  1. Chris Anderson

    January 25, 2021

    very nice info! thanks

    Reply
  2. Joy Apple

    January 25, 2021

    bomb.com! Thank you!

    Reply
  3. fritz Schick

    January 25, 2021

    This is great to know.
    Thanks!

    Reply
  4. Robert Davis

    January 26, 2021

    Great tip! Thank you!!

    Reply
  5. Somy

    January 28, 2021

    Awesome! Along SPFx solution, this is even cooler!

    Reply

Leave a Reply


I've been working with Microsoft Technologies over the last ten years, mainly focused on creating collaboration and productivity solutions that drive the adoption of Microsoft Modern Workplace.