Home Forums ACF PRO Change oEmbed youtube URL


Change oEmbed youtube URL

  • Hello,

    With the new GDPR law you have to give users an option wich cookies they want to be placed or not.

    Youtube will place multiple marketing cookies when you embed a video. There is a way to avoid this. When you change the URL to “” it wont place a cookie.

    Is there a way to change the source “” to “” with the advanced custom field oEmbed?

  • Hi @precies

    You can try this function to filter out the output:

    This will allow you to replace the string with the string. If you haven’t done that before, just look up “string replace php”


  • Hello @nathanaelphilip

    I don’t really see how you can do it with the string replace php. Could you please help me on this matter?


  • Hey, did you find a solution for this?

  • <?php echo str_replace('', '', get_field('my_video')); ?>

  • Does not work for me. Not sure why this would be on render of the input (?) and not use update_value. I’ve posted as a separate question in General.

  • Putting something like this in the template is the best I could come up with:

    			$iframe = get_field('video');
    			$iframe = str_replace('', '', $iframe);
    		<div class="minus6db-video"><?php echo $iframe ?></div>
Viewing 7 posts - 1 through 7 (of 7 total)

The topic ‘Change oEmbed youtube URL’ is closed to new replies.