If you add a Youtube video in a normal Divi video field, Youtube suggests related video’s at the end.
Adding rel=0 does not work as it is not supported by the Divi modules.
To fix add this bit of Javascript under Integration –> Add code to the head of your blog in Divi Theme Options:
<script>
jQuery(document).ready(function($ ) {
// add '&rel=0' to end of all YouTube video URL's
// to prevent displaying related videos
$('.nosuggestion iframe').attr( "src", function( i, val ) {
return val + '&rel=0';
});
});
</script>
Code language: HTML, XML (xml)
Or https://www.peeayecreative.com/how-to-hide-related-youtube-videos-in-divi/
<script>
jQuery(document).ready(function($ ) {
// add '&rel=0' to end of all YouTube video URL's
// to prevent displaying related videos
$('.et_pb_video iframe').attr( "src", function( i, val ) {
return val + '&rel=0';
});
});
</script>
Code language: HTML, XML (xml)