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?


    • enky

    • April 5, 2019 at 8:11 pm

    Hey, did you find a solution for this?

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

    • Enaldi

    • August 17, 2019 at 8:16 am

    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.

    • Enaldi

    • August 17, 2019 at 10:32 am

    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)

You must be logged in to reply to this topic.

We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Cookie Policy. If you continue to use this site, you consent to our use of cookies.