Video Outside the Viewport Fast and Easy Solution. No Plugin

How to fix the WordPress error of video outside the viewport

Content Roadmap

Fixing the “Video Outside the Viewport” Google Seach Console Errors

If you’re seeing “Video Outside the viewport” errors in Google Search Console, it means some of your videos are not fully responsive to users screen sizes when the page loads. This usually happens when the video player is lower on the page and users need to scroll down to see it.

Screenshot of the google seach console dashboard showing the video outside the viewport error

The good news is; you found the easy fix:

🏆 Solution: Enabling Responsive YouTube Embeds

Simply add one line of code to your theme’s functions.php file:

Step 1 – Log in to WordPress admin and go to Appearance > Theme Editor

Screenshot showing how to get to the theme editor on wordpress - fixing video outside the viewport

Step 2 – Click to edit the functions.php file

Screenshot showing how to get to the function. Php editor on wordpress - fixing video outside the viewport

Step 3 – Add this code:

Step 4 – Save changes👍

Your YouTube embeds in WordPress posts and pages are not responsive due to your theme not supporting responsive embeds. However, You just found the good news – fixing this issue is that simple!

The Core of the Issue: Theme Support for Responsive Embeds

Recently updated WordPress themes often don’t call the “responsive embeds” theme support function. This results in YouTube videos staying static in size, instead of resizing responsively for mobile devices.

While it seems the new Gutenberg editor is related, the root cause lies with themes not enabling responsive embed support. So calling this function is the key to fix non-responsive YouTube embeds.

This will tell your theme to support responsive embeds across your site. Embedded YouTube videos will now resize responsively, ensuring proper display on all devices.

Extra Help for the Video Outside the Viewport GSC Issue!

Enhance YouTube Embeds with Plugins

While WordPress supports embedding YouTube videos without any plugins, there are some handy plugins that add extra functionality:

📼 Lazy Load Videos

This lightweight plugin delays loading video embeds until the user clicks on them. This speeds up load times, improving site performance.

📼 YouTube Gallery Plugin

Want to showcase videos on a dedicated page? This plugin lets you create YouTube video gallery pages to highlight your channel or playlists.

📼 Video Gallery – YouTube Gallery

Another gallery plugin, this one focuses just on YouTube videos. It has responsive layouts to showcase your videos on any device.

📼 WP Video Lightbox

Make your videos stand out by displaying them in a popup lightbox. When users click a video, it expands to fullscreen with a blurred background.

📼 Testing Plugin Compatibility

As with any plugin, be sure to test how they interact with your theme. Check that your responsive YouTube embeds continue working properly with any additional functionality added.

These plugins might will give you more options for showcasing YouTube videos across your WordPress site!

Closing the Case

Embedding YouTube videos in your WordPress site is a great way to enhance content and engage visitors. However, if videos fail to resize or display properly across devices, the user experience suffers.

Luckily, implementing responsive embed support is a straightforward one-line update.

By adding the recommended code snippet to your active theme’s functions.php file, you enable fluid responsive YouTube embeds site-wide. Videos will then scale gracefully to match any screen size. We covered compatible plugins as well, for additional video gallery, performance, and display options.

With the right theme support enabled, you can confidently embed YouTube videos knowing they’ll contribute to—not detract from—your website’s reliability and visit quality. Smoothly responsive video embeds improve engagement and keep visitors focused on your content, boosting your WordPress site’s credibility and authority over time through optimal on-site UX.

Jesus Guzman

M&G Speed Marketing LTD. CEO

Jesus Guzman is the CEO and founder of M&G Speed Marketing LTD, a digital marketing agency focused on rapidly growing businesses through strategies like SEO, PPC, social media, email campaigns, and website optimization. With an MBA and over 11 years of experience, Guzman combines his marketing expertise with web design skills to create captivating online experiences. His journey as an in-house SEO expert has given him insights into effective online marketing. Guzman is passionate about helping businesses achieve impressive growth through his honed skills. He has proud case studies to share and is eager to connect to take your business to the next level.