Acceptance criteria:
AC1: List the AMP support for all native WordPress widgets, as produced by the script in #839.
This from AC5 in #839:
AC5: One story will be created as an outcome of the Discovery to address enhanced/added support for sidebar widgets.
When AMP doesn't support a widget, either describe it in detail here, or open a sub-issue.
There doesn't seem to be an issue for this yet.
Widget AMP Support
Widget | Status | Note
--- | --- | ---
Archives without 'dropdown' | โ
Archives with 'dropdown' | โ | AMP error from the script on the onchange attribute
Audio | โ | Has AMP errors
Calendar | โ
Categories without 'dropdown' | โ
Categories with 'dropdown' | โ | 2 AMP errors
Custom HTML | โ
Gallery | โ | Displays, but has AMP errors
Image | โ | Displays, but has AMP errors
Meta | โ
Nav Menu | โ
Pages | โ
Recent Comments | โ | WP_Widget_Recent_Comments::recent_comments_style() outputs illegal style element in head.
RSS | โ | Echoes illegal <img>
Video | โ | 2 AMP errors
AMP Errors
Archives Widget with "dropdown"
<select id="archives-dropdown-106" name="archive-dropdown" onchange='document.location.href=this.options[this.selectedIndex].value;'>widget(), so we might subclass this, as @westonruter suggested.Categories Widget with "dropdown"
<form>:<script type='text/javascript'><script>. We'll also have to use the amp-form extension.<style>.<img> elements by calling wp_get_attachment_link() or wp_get_attachment_image. Only wp_get_attachment_image_link() has a filter that we could use. WP_Widget_Recent_Comments::recent_comments_style() renders a disallowed style element in head. @kienstra these are all supported now via #870, right?
All Widgets Supported, But Gallery Widget Might Benefit From amp-carousel
Hi @westonruter,
Sorry for the delay here. All of the widgets above are now supported, without any AMP error.
But the 'Gallery' widget might be able to use an <amp-carousel>. It looks plain now:

AMP_Gallery_Embed looks to convert 'gallery' shortcodes into <amp-carousel> elements. I'll look at whether it could help with this.
@kienstra I just found that neither YouTube nor Vimeo videos work in the video widget:


This may require extending the video widget like you had done originally.
See relevant logic in https://github.com/WordPress/wordpress-develop/blob/1c4f57f425fed9bec01e558d22d1fb751881e347/src/wp-includes/widgets/class-wp-widget-media-video.php#L128-L145
Another option would be to add a wp_video_shortcode_override filter. In fact, this would work for the gallery as well via the post_gallery filter. I'm not 100% sure if it is better to use the filter vs. override the gallery shortcode. Jetpack actually uses the post_gallery filter:
Thanks For The Details
Hi @westonruter,
Thanks for catching that YouTube and Vimeo videos don't work, and for your details on fixing it. If it's alright, I'll work on this tomorrow (Tuesday).
Request For QA
Hi @csossi,
Could you please test this ticket? The widgets look to appear and work as expected in my local environment.
The test site might not be the best place for this, as it'll distort the pages when we place 20-30 test widgets in the sidebar.
We should run the widget test script on a site, as it will insert all of the needed widgets. As long as the site already has 3 videos and 3 audio files.
Test Page
Hi @csossi,
Could you please test the widgets on this test page?
Please verify these widgets:
verified in QA
@kienstra could kindly update the list of widget supported now that the work is done. It would be great to have it in the WIKI and then change all instances of the tables to link to the wiki to avoid confusion.
PS: this should apply to embeds too
Awesome, thanks @kienstra
Most helpful comment
Added Page To Wiki
Hi @ThierryA,
This new page in the project wiki has the updated matrices for widget and embed support. Also, I made a comment in the existing matrices, referencing that wiki page.