Are you looking to improve the quality of your YouTube preview images in the Perfmatters plugin? We have just the solution for you! Today, I’m excited to introduce you to a highly useful helper plugin that significantly enhances the quality of YouTube preview images when you enable Lazy Loading iFrames and Videos in the Perfmatters plugin.
A lot of Perfmatters users may have already noticed that enabling Lazy Loading for YouTube videos results in poor-quality preview images. This occurs due to the default setting in the Perfmatters plugin, which uses a low-quality screenshot for the swap.
However, with my plugin, you can enjoy maximum thumbnail quality (maxresdefault). By using this helper plugin, all YouTube previews will be displayed in excellent quality. To ensure optimal results, please make sure your YouTube thumbnails are at least 1280 x 720 pixels in size. I also recommend this article – Best YouTube Thumbnail Size
#1 Solution via plugin
To get started, simply install and activate the plugin. Best of luck!
Download Plugin – Perfmatters Youtube HQ Preview
#2 Solution via Code
You can also solve this problem by adding the code to the fucntions.php file of your child theme.
You can change the value in the $resolution = ‘maxresdefault’ line to increase or decrease the quality of the preview image.
The existing values are:
‘maxresdefault’,
‘sddefault’,
‘mqdefault’,
‘hqdefault’,
‘default’
add_filter('perfmatters_lazyload_youtube_thumbnail_resolution', function($resolution) {
if(!wp_is_mobile()) {
$resolution = 'maxresdefault';
}
return $resolution;
});
Analytical & Research Agency says
It’s very interesting!