YouTube URL to video

Hi,

When I post a YouTube URL it automatically turns into a video. Where can I find the code that does this?
I want to cut that code out and only add the code when the visitor accepts my Social Cookies.

Hello Vink,

Thanks for writing in! The Youtube url turns to video feature is a default feature in WordPress. You should be able to find more information about this feature from this codex:

Hope this helps.

Hi,

Thank you for your quick reply!
I still can’t seem to find out in what file the code is produced…

Hi Vink,

I guess you want to disable this feature of automatic embeds right? If so try following this guide here (https://www.wpbeginner.com/plugins/how-to-turn-off-related-videos-when-embedding-youtube-videos-in-wordpress/).

Basically you will need to append the following code ?rel=0 into your YouTube URL.

Thanks!

Hi,

What i’m looking for is the code that turns my YouTube URL automatically into a video. I want to find that code delete it from the file and paste it in my Cookie Plugin header script. So that if people don’t accept my Cookies they won’t be able to see the video, only the URL of the video, but when they do accept my Cookies, the URL will turn automatically into a video.

Hi @macvink,

This feature is in the Wordpress core itself and is not set by the theme. What you could possibly do it to disable the default Wordpress embed and create your custom implementation. As this isn’t a feature offered by X, this would be outside the scope of support we can offer. You may wish to consult a developer to assist you with this. X is quite extensible with child themes, so there are plenty of possibilities.

Thank you.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.