Title: Twitter Embed Breaks AMP
Last modified: August 10, 2017

---

# Twitter Embed Breaks AMP

 *  Resolved [jpeek](https://wordpress.org/support/users/jpeek/)
 * (@jpeek)
 * [8 years, 11 months ago](https://wordpress.org/support/topic/twitter-embed-breaks-amp/)
 * Looks like the twitter embed breaks AMP pages due to a leftover empty <script
   ></script> tag set.
    This doesn’t occur when just using the regular WP embed.
   Is it not possible to NOT have this plugin take over embeds that WordPress can
   already handle? I just wanted it for the stuff that WordPress doesn’t do. I’ve
   had to disable it for the time being as valid AMP pages are more important.

Viewing 15 replies - 1 through 15 (of 18 total)

1 [2](https://wordpress.org/support/topic/twitter-embed-breaks-amp/page/2/?output_format=md)
[→](https://wordpress.org/support/topic/twitter-embed-breaks-amp/page/2/?output_format=md)

 *  [PressShack](https://wordpress.org/support/users/pressshack/)
 * (@pressshack)
 * [8 years, 11 months ago](https://wordpress.org/support/topic/twitter-embed-breaks-amp/#post-9398886)
 * Thanks for reporting that [@jpeek](https://wordpress.org/support/users/jpeek/)
   and sorry for the bug. We’ll have a fix out very shortly.
 * PublishPress Embeds should default to normal WP embeds, but we made a small typo
   there.
 *  Thread Starter [jpeek](https://wordpress.org/support/users/jpeek/)
 * (@jpeek)
 * [8 years, 11 months ago](https://wordpress.org/support/topic/twitter-embed-breaks-amp/#post-9398936)
 * Awesome, I’ll keep an eye out for the update and the patch notes 🙂
 *  [andergmartins](https://wordpress.org/support/users/andergmartins/)
 * (@andergmartins)
 * [8 years, 11 months ago](https://wordpress.org/support/topic/twitter-embed-breaks-amp/#post-9399107)
 * Hi [@jpeek](https://wordpress.org/support/users/jpeek/),
 * I wasn’t able to reproduce the issue. Please, could you describe the steps to
   reproduce that? What plugin have you used for AMP?
 * Please, could you check and describe where is the empty “script” tag being printed?
   Please, could you send a copy of the output or a screenshot?
 * Looking forward to helping,
 * Thanks
 *  Thread Starter [jpeek](https://wordpress.org/support/users/jpeek/)
 * (@jpeek)
 * [8 years, 11 months ago](https://wordpress.org/support/topic/twitter-embed-breaks-amp/#post-9399218)
 * I’m using the AMP plugin by Automattic. It’s possible that it’s their fault, 
   but it doesn’t happen when using the regular WP twitter embed, hence my post 
   here 🙂
 * I don’t have a live example, but here’s a screenshot and the resulting html including
   the empty script tag that causes the problem:
 *     ```
       <div class="embedpress-wrapper ose-twitter ose-uid-b504b2195d3bc35403bba20fe64694cc responsive">
          <blockquote class="twitter-tweet" data-width="550">
             <p lang="en" dir="ltr">Guardians rejoice! Get your hands on some exotic loot with our official <a href="https://twitter.com/hashtag/Destiny2?src=hash">#Destiny2</a> range: <a href="https://t.co/FH7C2Tk1cI">https://t.co/FH7C2Tk1cI</a> <a href="https://t.co/WErZb3jwpl">pic.twitter.com/WErZb3jwpl</a></p>
             — Numskull Designs (@NumskullDesigns) <a href="https://twitter.com/NumskullDesigns/status/895689826686689280">August 10, 2017</a>
          </blockquote>
          <script></script>
       </div>
       ```
   
 * [http://prntscr.com/g6wjjn](http://prntscr.com/g6wjjn)
 *  Thread Starter [jpeek](https://wordpress.org/support/users/jpeek/)
 * (@jpeek)
 * [8 years, 11 months ago](https://wordpress.org/support/topic/twitter-embed-breaks-amp/#post-9399781)
 * Just noticed that this also happens with Reddit embeds. Again, this may very 
   well be a shortcoming of the AMP plugin but…
 *  [PressShack](https://wordpress.org/support/users/pressshack/)
 * (@pressshack)
 * [8 years, 11 months ago](https://wordpress.org/support/topic/twitter-embed-breaks-amp/#post-9399815)
 * Thanks for such useful feedback, [@jpeek](https://wordpress.org/support/users/jpeek/).
   We’ll get a fix out ASAP
 *  [andergmartins](https://wordpress.org/support/users/andergmartins/)
 * (@andergmartins)
 * [8 years, 9 months ago](https://wordpress.org/support/topic/twitter-embed-breaks-amp/#post-9574331)
 * Hi [@jpeek](https://wordpress.org/support/users/jpeek/),
 * We worked on a fix for the issue with the AMP plugin and Twitter and Reddit embeds.
 * Please, could you try the following package?
 * [http://packages-tmp.s3.amazonaws.com/52c6a5be5b3fc31e7d444e387dbac2d5/embedpress-2.0.1a1.zip](http://packages-tmp.s3.amazonaws.com/52c6a5be5b3fc31e7d444e387dbac2d5/embedpress-2.0.1a1.zip)
 * Please, let us know if the issue is fixed.
 * Looking forward to helping
 *  Thread Starter [jpeek](https://wordpress.org/support/users/jpeek/)
 * (@jpeek)
 * [8 years, 9 months ago](https://wordpress.org/support/topic/twitter-embed-breaks-amp/#post-9574707)
 * Been a while since I looked at this more closely and for some reason things seem
   to be working over the past few months. I *think* I made a tweak to the AMP plugin
   to work around the issue but…
 * anyway… tried out the new version and got the following error:
 * Fatal error: Class name must be a valid object or a string in […]\wp-content\
   plugins\embedpress\EmbedPress\AMP\EmbedHandler.php on line 47
 *  [andergmartins](https://wordpress.org/support/users/andergmartins/)
 * (@andergmartins)
 * [8 years, 9 months ago](https://wordpress.org/support/topic/twitter-embed-breaks-amp/#post-9574786)
 * Hi [@jpeek](https://wordpress.org/support/users/jpeek/),
 * Alright, sorry about that. Please, could you try this new package?
 * [http://packages-tmp.s3.amazonaws.com/76ce856dc4a1cdd1ef6b57f6d52fcacf/embedpress-2.0.1a2.zip](http://packages-tmp.s3.amazonaws.com/76ce856dc4a1cdd1ef6b57f6d52fcacf/embedpress-2.0.1a2.zip)
 * Thanks,
 *  Thread Starter [jpeek](https://wordpress.org/support/users/jpeek/)
 * (@jpeek)
 * [8 years, 9 months ago](https://wordpress.org/support/topic/twitter-embed-breaks-amp/#post-9574821)
 * That seems to work. Looks like the tweet is embedding nicely now and I’ve validated
   the page source for AMP compliance and it passed.
 *  Thread Starter [jpeek](https://wordpress.org/support/users/jpeek/)
 * (@jpeek)
 * [8 years, 9 months ago](https://wordpress.org/support/topic/twitter-embed-breaks-amp/#post-9574839)
 * To follow up, I did notice that the Reddit embed in the AMP version has a lot
   of additional padding at the bottom for some reason.
 * > [View post on imgur.com](https://imgur.com/2VoGLij)
 *  [andergmartins](https://wordpress.org/support/users/andergmartins/)
 * (@andergmartins)
 * [8 years, 9 months ago](https://wordpress.org/support/topic/twitter-embed-breaks-amp/#post-9578442)
 * Hi [@jpeek](https://wordpress.org/support/users/jpeek/),
 * Thank you for confirming the fix and for reporting the new issue.
    We will take
   a look on it.
 * Thanks
 *  [andergmartins](https://wordpress.org/support/users/andergmartins/)
 * (@andergmartins)
 * [8 years, 9 months ago](https://wordpress.org/support/topic/twitter-embed-breaks-amp/#post-9585512)
 * Hi [@jpeek](https://wordpress.org/support/users/jpeek/),
 * We have a new alfa package addressing the issue you reported on Reddit.
 * [http://packages-tmp.s3.amazonaws.com/ef1f687fa3862a12fdb4e7eda535ea1a/embedpress-2.0.1a4.zip](http://packages-tmp.s3.amazonaws.com/ef1f687fa3862a12fdb4e7eda535ea1a/embedpress-2.0.1a4.zip)
 * But unfortunately, it requires manually adjust the size on each embed. Reddit
   returns different sizes according to each content, and the OEmbed API doesn’t
   return the current size. Since it is inside an iframe, we can’t manipulate that.
   By default, each embed has a squared proportion of 1:1. You can edit the embed
   and set a custom size (which will make it calculate the correct proportion).
 * Please, let us know if that helps.
 * Kind regards,
 *  Thread Starter [jpeek](https://wordpress.org/support/users/jpeek/)
 * (@jpeek)
 * [8 years, 9 months ago](https://wordpress.org/support/topic/twitter-embed-breaks-amp/#post-9589506)
 * Thanks, that seems to work. Not ideal but it does the job 🙂
 *  Thread Starter [jpeek](https://wordpress.org/support/users/jpeek/)
 * (@jpeek)
 * [8 years, 9 months ago](https://wordpress.org/support/topic/twitter-embed-breaks-amp/#post-9589515)
 * On an unrelated note, I noticed the following error when embedding an Instagram
   post. The post still embeds nicely, but the warning is displayed at the top of
   the content.
 * Warning: Attempt to assign property of non-object in ….\wp-content\plugins\embedpress\
   EmbedPress\Shortcode.php on line 138

Viewing 15 replies - 1 through 15 (of 18 total)

1 [2](https://wordpress.org/support/topic/twitter-embed-breaks-amp/page/2/?output_format=md)
[→](https://wordpress.org/support/topic/twitter-embed-breaks-amp/page/2/?output_format=md)

The topic ‘Twitter Embed Breaks AMP’ is closed to new replies.

 * ![](https://ps.w.org/embedpress/assets/icon-128x128.gif?rev=3419899)
 * [EmbedPress – PDF Embedder, 3D PDF FlipBook, Google Reviews, YouTube Videos, Upload & Embed PDF documents](https://wordpress.org/plugins/embedpress/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/embedpress/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/embedpress/)
 * [Active Topics](https://wordpress.org/support/plugin/embedpress/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/embedpress/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/embedpress/reviews/)

 * 18 replies
 * 3 participants
 * Last reply from: [andergmartins](https://wordpress.org/support/users/andergmartins/)
 * Last activity: [8 years, 9 months ago](https://wordpress.org/support/topic/twitter-embed-breaks-amp/page/2/#post-9592377)
 * Status: resolved