Use the Embed web part

When you add a modern page to a site, you add and customize web parts, which are the building blocks of your page. This article describes the Embed web part.

You can display content on your page from sites that allow embedding (like YouTube, for example). Depending on the site, you can either use the site's web address or embed code that the site provides. 

Embed code is a list of specific instructions from a website that describe how to display that content on another page. Many sites offer embed codes on their pages if they allow embedding. You will typically see a button labeled Embed code or </>. This will open a text box with some code in it. Just copy and paste the code. 


  • Keep in mind that the embed code must be iframe-based (that is, start and end with <iframe> tags). Embed code that uses <script> tags is not supported. For more information on using embed code, see Add content to your page using the Embed web part.

  • Only secure web sites can be embedded. Make sure the URL of the web site begins with HTTPS.

  • Not all websites allow their pages to be embedded, so you may not be able to embed them, even when they are secure and use iframe-based embed code. If you have problems, check with the website to see if they allow embedding.

  • Site collection administrators can control whether users can embed content from external websites. If they don't let contributors embed content, you may see an error message that says, “Embedding content from this website isn't allowed.” See your administrator and/or the help article Allow or restrict the ability to embed content on SharePoint pages.

Add the Embed web part

  1. If you're not in edit mode already, click Edit at the top right of the page.

  2. Hover your mouse above or below an existing web part or under the title region, click Circled plus sign used to add a modern web part to a page , and then select the Embed web part.

  3. In the toolbox on the right, add the web address of the web site or the embed code from the site.

    Embed Web Part tool box

Expand your Office skills
Explore training
Get new features first
Join Office Insiders

Was this information helpful?

Thank you for your feedback!

Thank you for your feedback! It sounds like it might be helpful to connect you to one of our Office support agents.