Support » Plugin: AMP » Disable YouTube Embed Handler?

  • Resolved casbboy


    I used to note out the YouTube embed handler, as we have a custom YouTube tag and the Amp Plugin causes all the embeds to break.

    On an older version of the plugin I just noted out:

    //require_once( AMP__DIR__ . ‘/includes/embeds/class-amp-youtube-embed.php’ );

    And everything was fixed, but if I remove :

    ‘AMP_YouTube_Embed_Handler’ => ‘includes/embeds/class-amp-youtube-embed’,

    I tried deleting that, but just 500 errored the amp pages.

    Any way to prevent the plugin from messing with Youtube?


Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Weston Ruter


    This is what you should do:

    add_filter( 'amp_content_embed_handlers', function( $handlers ) {
        unset( $handlers['AMP_YouTube_Embed_Handler'] );
        return $handlers;
    } );

    Add this to a custom theme or custom plugin.

    Worked perfect.


Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Disable YouTube Embed Handler?’ is closed to new replies.