Embed code is HTML markup that places externally hosted content—such as a YouTube video—inside a page on your website. The provider generates the code, so you can copy it rather than build the player from scratch. section 8.3.2 section 8.3.4
Add a YouTube video to a WordPress page in a few actions:
- Open YouTube, find your uploaded video, choose Share, select Embed, and copy the generated HTML code. section 8.3.2
- In WordPress, open the target page, place the cursor where the player belongs, and select the Text tab. section 8.3.3
- Paste the code, click Update or Publish, and use View Page or the Visual tab to check and play the video. section 8.3.3
Make the player friendlier
An iframe can include a src URL for the hosted video, width and height for its dimensions, and a title for screen readers. Remove autoplay if visitors should decide when media starts. Fixed dimensions may resize poorly on phones, tablets, or monitors, so test the page on each display. section 8.3.4
Figure 8.4 After you click the < > Embed icon shown here, you can view the HTML code that actually connects your site to the YouTube video you uploaded.
The figure shows where YouTube exposes the HTML code that connects a site to an uploaded video. section 8.3.2
Technical editing is optional. EmbedPress can create the necessary code from a pasted source URL in a WordPress block or classic editor, and supports many media sources and file types. section 8.8
