[wp-trac] [WordPress Trac] #44610: Allow Youtube-Player to use youtube-nocookie.com URLS to avoid setting cookies.

WordPress Trac noreply at wordpress.org
Thu Feb 3 14:07:29 UTC 2022


#44610: Allow Youtube-Player to use youtube-nocookie.com URLS to avoid setting
cookies.
-------------------------------------------------+-------------------------
 Reporter:  jepperask                            |       Owner:
                                                 |  williampatton
     Type:  enhancement                          |      Status:  assigned
 Priority:  normal                               |   Milestone:  Future
                                                 |  Release
Component:  Embeds                               |     Version:  4.9.7
 Severity:  normal                               |  Resolution:
 Keywords:  needs-testing has-patch needs-dev-   |     Focuses:  privacy
  note close                                     |
-------------------------------------------------+-------------------------

Comment (by jottevanger):

 Replying to [comment:55 Mte90]:
 > In the meantime there is any hope to get new videos with nocookie.com?
 > There are websites with very strict requirements for GDPR and so on.
 Absolutely right, and it's remarkable that this hasn't been addressed yet
 in spite of the wealth of discussion and advice here! But in the meantime
 I just have this in my theme file:

 {{{
 add_filter( 'embed_oembed_html', 'privatise_oembed_youtube', 99, 4 );

 function privatise_oembed_youtube( $cached_html, $url, $attr, $post_id ) {
     $cached_html = str_replace("www.youtube.com/embed","www.youtube-
 nocookie.com/embed", $cached_html);
     return $cached_html;
 }
 }}}
 It will suffice for now!

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/44610#comment:56>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list