I prefer using &rel=0 as a YouTube parameter so that only MY videos get listed in the "More Videos" feature.
I have been using the following string in the WordPress editor for a couple of years and it has worked until a day or two ago.
;rel=0
Yes, many places inside WordPress "help" in converting that string to what some developer assumes I want, and removes the "rel=0" parameter. Today's result is an iframe like this:
<iframe title="Stress Pattern: 2-syllable verbs" width="700" height="394" src="" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe></p>
What code stripped the "rel=0" ... and added all those strange "allow" parms?
I prefer using &rel=0 as a YouTube parameter so that only MY videos get listed in the "More Videos" feature.
I have been using the following string in the WordPress editor for a couple of years and it has worked until a day or two ago.
https://www.youtube/watch?v=PRw1q6aJtnQ&rel=0
Yes, many places inside WordPress "help" in converting that string to what some developer assumes I want, and removes the "rel=0" parameter. Today's result is an iframe like this:
<iframe title="Stress Pattern: 2-syllable verbs" width="700" height="394" src="https://www.youtube/embed/PRw1q6aJtnQ?feature=oembed" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe></p>
What code stripped the "rel=0" ... and added all those strange "allow" parms?
Share Improve this question asked Jan 22, 2020 at 12:24 Bob EastonBob Easton 1231 silver badge7 bronze badges 6 | Show 1 more comment1 Answer
Reset to default 2Iframe content is generated by youtube itself, wordpress just requests it via oembed call. If you wish you can study wp-includes/class-oembed.php
code, but that will not help you to change iframe parameters. For that you may apply embed_oembed_html
filter, see https://developer.wordpress/reference/hooks/embed_oembed_html/. It receives iframe html code, so you can do some string replacements to change it.
unfiltered_html
capability, aka if you're an admin or a super admin on a multisite, and isn't how you're meant to do this. WP is supposed to strip things like iframes out of your content. – Tom J Nowell ♦ Commented Jan 22, 2020 at 12:33rel
parameter changed in 2018, it doesn't mean the same thing developers.google/youtube/…, which editor are you using? What did you change a day or two ago that triggered this? ( this wouldn't have just started happening unless code changed, unless you're actually on WordPress or a managed host? That's important info to know ), and how are you embedding it into the post? There are several ways to embed things from youtube, but you didn't state which one you were using – Tom J Nowell ♦ Commented Jan 22, 2020 at 12:33