Clients don’t particularly love it when their own videos hosted on youtube, are played via their websites, and then the visitor is presented with a bunch of video recommendations NOT related at all to your site or channel.

The solution is to pass a parameter in the video URL so no “suggested videos” are shown when the video ends. This is easily done by appending “?rel=0” to the existing youtube video URL.

Though… the surprise Divi devs will face when they try to append this to the URL is that Divi strips it out! So what to do?

The solution which I found from a five year old PEE-AYE Creative article, and works today (March 2025), is to use jquery to append the “?rel=0” to your youtube URL.

The jquery code is as follows:

<script>
jQuery(document).ready(function($ ) {
// add '&rel=0' to end of all YouTube video URL's
// to prevent displaying related videos
$('.pa-hide-related-videos iframe').attr( "src", function( i, val ) {
return val + '&rel=0';
});
});
</script>

 

PEE-AYE’s article will show you how to either add the jquery code to your page for the one video, or show you how to add the code to work globally for all the videos on your site.

In the case of adding it just for the one video, the solution is to add a CODE module in Divi before where the video appears on your page. Just insert the code module and add the code above to it. Now, your video will no longer show suggested related videos when your video finishes playing!

Special thanks once again to Nelson at PEE-AYE Creative for his excellent resources.