Enable AMP on your WordPress site, the WordPress way.
This is a maintenance release, following up on 2.2.1 from 2 months ago. For the full list of issues and pull requests in this release, please see the 2.2.2 milestone with 25 closed issues and 35 merged pull requests (minus dependency updates). See full diff of changes.
img
without any PX-verified exemptions. In the subsequent 2.3 release images will no longer be converted to amp-img
/amp-anim
by default and native img
will be used instead (per #6805). (#6803)amp-next-page
. (#6909, #6312)picture
element tree when sanitizing by promoting child fallback img
in conversion to amp-img
; add sanitizer argument to retain picture
as PX-verified. (#6676, #6896)img
with amp-pixel
instead of amp-img
when sanitizing the Facebook tracking pixel. (#6059, #6965)amp-wordpress-embed
. (#809, #6665)gallery
shortcode embed handler to account for no shortcode attributes (improving PHP 8 compat). (#6939)wp_unique_id()
-based block class names instead of uniqid()
and reset the disabling of CSS transient caching in affected versions of WordPress/Gutenberg. (#6925, #6949, #7004)wp_remote_retrieve_header()
returning arrays when duplicate response headers are present. (#6937, #6938)src/
into assets/
. (#6947, #6952, #6955)Alain Schlesser (@schlessera), Alberto Medina (@amedina), Bartosz Gadomski (@bartoszgadomski), Daniel Rueda (@danirueda), Dhaval Parekh (@dhaval-parekh), Edi Amin (@ediamin) Fellyph Cintra (@fellyph), James Osborne (@jamesozzie), John Watkins (@johnwatkins0), Lovekesh Kumar (@thelovekesh), Maitreyie Chavan (@maitreyie-chavan), Milind More (@milindmore22), Nikhil Joshua (@NikhilJoshua), Pierre Gordon (@pierlon), Piotr Delawski (@delawski), Pooja Killekar (@pooja-muchandikar), Rutvik Savsani (@rutviksavsani), Ryan Welcher (@ryanwelcher), Weston Ruter (@westonruter)
Now available to install via WordPress.org.
You can also install the amp.zip
build linked below by uploading it in the WordPress admin.
To install as a Git submodule, consider 2.2.2-built.
This is a maintenance release, following up on 2.2.0 from 2 months ago. This release improves compatibility with changes in WordPress 5.9, including block-based themes like Twenty Twenty-Two. For the full list of issues and pull requests in this release, please see the 2.2.1 milestone with 11 closed issues and 12 merged pull requests (minus dependency updates). See full diff of changes.
amp-youtube
with fixed-height layout (#6837, #6834)gutenberg_render_layout_support_flag()
(#6850)Alain Schlesser (@schlessera), Alberto Medina (@amedina), Bartosz Gadomski (@bartoszgadomski), Dhaval Parekh (@dhaval-parekh), Edi Amin (@ediamin), Fellyph Cintra (@fellyph), Maitreyie Chavan (@maitreyie-chavan), Milind More (@milindmore22), Pascal Birchler (@swissspidy), Pierre Gordon (@pierlon), Piotr Delawski (@delawski), Weston Ruter (@westonruter)
Now available to install via WordPress.org.
You can also install the amp.zip
build linked below by uploading it in the WordPress admin.
To install as a Git submodule, consider 2.2.1-built.
For the full list of changes in this release, please see the 2.2 milestone, with 44 closed issues and 116 merged pull requests (minus dependency updates). Read on for the full details.
Introduce experimental support for a more flexible AMP via Bento with dynamic levels of sandboxing enforcement. (See Bento introduction post on AMP Blog.) The Sandboxing experiment can be enabled when using the Standard template mode, and you may choose a minimum sandboxing level of loose, moderate, or strict.
data-px-verified-tag
attribute to the script
tag.)The sandboxing levels are dynamic, so if you select Loose but there is no invalid AMP markup on the page, it will automatically upgrade to Strict. (#6443, #6546, #6769, #5549, #6715, #6787, #6788, #6767, #6577, #6757)
noscript
unwrapping, and disables unwrapping whenever custom non-AMP scripts are kept. (#6030, #6528)img
. This involves a native_img_used
argument on the image sanitizer which is disabled by default, but it will be enabled by default in the next release (since native img
will be valid AMP). It is enabled when in the loose sandboxing level. (#6518)POST
forms from being converted to amp-form
(with action-xhr
). This opt-in is enabled when in loose or moderate sandboxing levels. (#6527)amp_bento_enabled
filter. (#6353, #6537)bento
-prefixed components. (#6722)video
is used. (#6762)Add Support screen that facilitates users to submit site information privately with a submission UUID to reference in a support topic. This eliminates the need for the Google Form we were previously using. (#5939, #6147, #6627, #6604, #6652, #6764, #6707, #6718)
amp-youtube
, including the seek time. (#4518, #6423)amp-twitter
to use fixed-height
layout with a default height matching minimal tweet height. (#6504, #6510)!important
qualifiers via new transform_important_qualifiers
argument to style sanitizer. (#6295, #6589)amp-story-captions
as element containing dynamic content. (#6628)wp_editor()
(#4750, #6670, #6668)core/shortcode
will no longer be blamed on WordPress core. (#6667, #6675)wp_comment_form_unfiltered_html_nonce()
and wp_post_preview_js()
as being in AMP Dev Mode so they are not sanitized; they only appear when logged-in and they are don't negatively impact PX. (#6680)preload
links and font-display
. (#6036, #6674)sanitize_key()
. (#6754)Remove plugin-specific data at plugin uninstallation. A new toggle on the settings screen allows uninstall without AMP data removal. (#3210, #6422, #6486, #6632)
amphtml
AMP-to-AMP linking attribute from links to fix broken structure data. (#6599, #6661)include_layout_in_wp_kses_allowed_html
. (#6572)SavePostValidationEvent
. (#6771)Thanks to the many contributors who made this release possible through work on development, design, testing, project management, and more:
Adam Silverstein (@adamsilverstein), Alain Schlesser (@schlessera), Alberto Medina (@amedina), Bartosz Gadomski (@bartoszgadomski), Bethany Chobanian Lang (@bethanylang), Dhaval Parekh (@dhaval-parekh), Edi Amin (@ediamin), Fellyph Cintra (@fellyph), Gagan Deep Singh (@gagan0123), James Osborne (@jamesozzie), Joshua Wold (@jwold), Ken Rodrigues (@kenrodriguesdesign), Maitreyie Chavan (@maitreyie-chavan), Milind More (@milindmore22), Pascal Birchler (@swissspidy), Paul Clark (@pdclark), Pierre Gordon (@pierlon), Piotr Delawski (@delawski), Pradeep Sonawane (@pradeep910), Rahul Bansal (@rahul286), Weston Ruter (@westonruter)
Now available to install via WordPress.org.
You can also install the amp.zip
build linked below by uploading it in the WordPress admin.
To install as a Git submodule, consider 2.2.0-built.
This is a maintenance release, following up on 2.1.3 from 2 months ago. (Work is ongoing for the 2.2 release which is due out the end of September.) For the full list of issues and pull requests in this release, please see the 2.1.4 milestone with 11 closed issues and 36 merged pull requests. See full diff of changes.
amp-carousel
script to be printed on page when there is just amp-lightbox-gallery
and no amp-carousel
, allowing v0.2 to be used instead of autoloading v0.1. (#6509)muted
attribute from amp-video
and its video
fallback when autoplay
is present, preventing AMP validation warnings from occurring. (#6581)calc()
from media queries in Legacy theme, preventing AMP validation warnings from being reported. (#6557, #6559)amp-tiktok
component. (#6060, #6558, #6586, #6574)object-fit:contain
styling (as is done for images with unknown dimensions). (#6578, #6571, #6576)validate_url()
when attempting validation requests to other sites (which will always fail). (#6582)wp_enqueue_scripts()
notice from appearing on the new block-based Widgets screen. (#6521, #6534)actions/setup-node
GHA. (#6544, #6541)Alain Schlesser (@schlessera), Alberto Medina (@amedina), @arthur791004, Dhaval Parekh (@dhaval-parekh), Joshua Wold (@jwold), @ktmn, Maitreyie Chavan (@maitreyie-chavan), Milind More (@milindmore22), Pascal Birchler (@swissspidy), Pierre Gordon (@pierlon), Piotr Delawski (@delawski), Roland Farkas (@rolandfarkasCOM), Thrijith Thankachan (@thrijith), Weston Ruter (@westonruter)
Now available to install via WordPress.org.
You can also install the amp.zip
build linked below by uploading it in the WordPress admin.
To install as a Git submodule, consider 2.1.4-built.
This 2.1.3 release follows up on 2.1.2 from 6 weeks ago. The key improvements in this release revolve around the Optimizer, paired URL routing, frontend/backend error handling, support for new AMP components, and compatibility with WordPress 5.8.
For the full list of issues and pull requests in this release, please see the 2.1.3 milestone with 6 closed issues and 18 merged pull requests. See full diff of changes.
amp-toolbox-php
to v0.6.0. This includes SSR support for fluid
layout, disabling link[rel=modulepreload]
on SSR'ed pages (to improve performance), improves handling of resource hints, among other changes.DetermineHeroImages
matches .amp-wp-article-content
in legacy Reader templates. (#6440)amp-render
, amp-iframely
, and amp-stream-gallery
. (#6303, #6425)data-ampdevmode
attribute to regenerator-runtime
script when enqueuing Paired Browsing scripts. This fixes a validation issue on WordPress 5.8. (#6416, #6419)test_get_mu_plugins_data
for WP 5.8. (#6434)test_amp_get_schemaorg_metadata
and test_wrap_widget_callbacks
in Gutenberg v10.8 and WP 5.8. (#6366)mysql2date()
to generate datePublished
and dateModified
in Schema.org metadata, causing bug in time offsets. (#6316, #6318)_n()
in /src/admin/site-health.php. (#6305, #6306)Alain Schlesser (@schlessera), Alberto Medina (@amedina), Dhaval Parekh (@dhaval-parekh), Evan Mattson (@aaemnnosttv), Francesco (@DrLightman), Joshua Wold (@jwold), Pascal Birchler (@swissspidy), Pierre Gordon (@pierlon), Piotr Delawski (@delawski), Tor-Björn Fjellner (@tobifjellner), Weston Ruter (@westonruter)
Now available to install via WordPress.org.
You can also install the amp.zip
build linked below by uploading it in the WordPress admin.
To install as a Git submodule, consider 2.1.3-built.
This 2.1.2 release follows up on 2.1.1 from 10 days ago, fixing bugs reported by a few users and making a couple enhancements.
For the full list of issues and pull requests in this release, please see the 2.1.2 milestone with 3 closed issues and 12 merged pull requests. See full diff of changes.
PairedRouting
, fixing compatibility with the Custom Permalinks. (#6197)HeroCandidateFiltering
when attachment post is not available. (#6256)Uncaught TypeError: Object(...) is not a function
on settings page. (#6194, #6225)ob_start()
being called during output buffer processing to avoid fatal error. The amp_get_schemaorg_metadata()
function is now called at template_redirect
before output buffer processing. (#6232, #6233)lint-js
job failure for dependabot PRs. (#6253)Alain Schlesser (@schlessera), Alberto A. Medina (@amedina), Evan Mattson (@aaemnnosttv), Joshua Wold (@jwold), @nbcsteveb, Pierre Gordon (@pierlon), Piotr Delawski (@delawski), Weston Ruter (@westonruter)
Now available to install via WordPress.org.
You can also install the amp.zip
build linked below by uploading it in the WordPress admin.
To install as a Git submodule, consider 2.1.2-built.
This release follows up on 2.1.0, fixing a couple issues reported since yesterday.
For the full list of issues and pull requests in this release, please see the 2.1.1 milestone with 3 merged pull requests. See full diff of changes.
amp_is_enabled
filter but then later it or another plugin/theme tries to call is_amp_endpoint()
/amp_is_request()
. A _doing_it_wrong()
notice is emitted instead of an exception being thrown. (#6181, #6184)Alain Schlesser (@schlessera), Milind More (@milindmore22), Pierre Gordon (@pierlon), Weston Ruter (@westonruter)
Now available to install via WordPress.org.
You can also install the amp.zip
build linked below by uploading it in the WordPress admin.
To install as a Git submodule, consider 2.1.1-built.
Some key features in this release include:
/amp/
, ?amp=1
, ?amp
, or even a completely custom URL scheme.module
scripts.For the full list of changes in this release, please see the 2.1 milestone, with 55 closed issues and 98 merged pull requests (minus dependency updates). Read on for the full details.
/amp/
URL endpoint was limited to single post URLs in Reader mode for the legacy post templates, whereas the ?amp
query param was used for pages and all URLs in Transitional mode and any AMP page using a Reader theme. These restrictions have been lifted, so now you can use any paired URL structure you like regardless of whether you're in Transitional or Reader mode and irrespective of the template being viewed. By default the ?amp=1
query param is used as the paired URL structure for new installs, but you can also use the /amp/
endpoint suffix for all paired URLs. You can even implement a totally custom structure, such as a subdomain or using a path prefix. When switching from /amp/
to ?amp=1
, redirects will prevent 404s. (#2204, https://github.com/ampproject/amp-wp/pull/5558, #4312, #5861, #5862, #2062, #3357, #4442, #5804)amp
to something else like lite
, you can do so either via the amp_query_var
filter or via the (deprecated) AMP_QUERY_VAR
constant. In early versions of the AMP plugin, this customization was commonly done in the theme. However, this happens much too late for the AMP plugin to be able to switch to a Reader theme or now to properly route paired AMP requests. Instead of limiting the user to the AMP Legacy theme and the ?amp=1
paired URL structure, when the query var is defined late it is now cached in an option so that it can be made available early in WordPress's execution (at plugins_loaded
). Since such late-defined slugs are still not ideal, a new Site Health check will recommend that you move it from the theme to a plugin. (#6125, #5789, #5859)Before | After |
---|---|
Before | After |
---|---|
data-hero-candidate
attribute to inform the Optimizer which images should also be identified as heroes for prerendering. Note that currently only the first two images with data-hero-candidate
will be prerendered (but see https://github.com/ampproject/amp-toolbox-php/issues/55#issuecomment-818090508). If you supply the data-hero
attribute on any image, then the Optimizer will disregard any images that have been marked with data-hero-candidate
. (#5055, #5350, #5824, #5923, #5934, #6168, #6062, #6061, https://github.com/ampproject/amp-toolbox-php/pull/141, https://github.com/ampproject/amp-toolbox-php/pull/149, https://github.com/ampproject/amp-toolbox-php/pull/144, https://github.com/ampproject/amp-toolbox-php/pull/141, https://github.com/ampproject/amp-toolbox-php/pull/136, https://github.com/ampproject/amp-toolbox-php/pull/135, https://github.com/ampproject/amp-toolbox-php/pull/115, #6111, #5823)RewriteAmpUrls
optimizer transformer was ported to amp-toolbox-php. This transformer rewrites AMP script
tags to use type=module
for supporting browsers. These scripts are comprised of ES modules which reduce the overall amount of code since polyfills for older browsers are omitted. Support for older browsers remains by serving the original AMP scripts with nomodule
. This transformer also allows opting-in to the LTS versions of AMP scripts (cf. #4600). Additional changes will facilitate script self-hosting in a future release. (#6037, https://github.com/ampproject/amp-toolbox-php/pull/140, https://github.com/ampproject/amp-toolbox-php/pull/130, https://github.com/ampproject/amp-toolbox-php/pull/122)amp-bind
. A new transformer has been added to the Optimizer which improves performance of amp-bind
by making it faster to locate the elements that have bound attributes when server-side rendering is enabled (as it is by default). (#6117, https://github.com/ampproject/amp-toolbox-php/issues/84, https://github.com/ampproject/amp-toolbox-php/pull/162, #6117)editor-color-palette
theme support), these predefined colors would be entirely absent when you viewed an AMP page in Reader mode—both for AMP Legacy templates and Reader themes. Styles were likewise missing for gradient presets (editor-gradient-presets
) and font sizes (editor-font-sizes
). This has now been fixed. All styles for these theme support features are now dynamically generated in PHP for inclusion on AMP pages. On the AMP Legacy templates, where the primary theme context is present, the theme support features are pulled straight from get_theme_support()
. When a Reader theme is active, however, the primary active theme's support features are not registered in memory; in this case, the active theme's support features are stored in an option so that they can then be available when the plugin switches to another theme for serving AMP pages in Reader mode. (#5229, #6042)object[type=application/pdf]
element will be automatically converted into an amp-google-document-embed
element. (#6083, #6112)object-fit
and object-position
styles. In the past when your theme used object-fit
/object-position
style properties on images and videos they would not show up on AMP pages when the img
and video
elements were converted into amp-img
and amp-video
respectively. This required having to add additional AMP-specific styling. This is no longer the case as the img
and video
elements that AMP creates inside of amp-img
and amp-video
now have default styling to inherit
these style properties. This also applies to the noscript
fallback images/videos. Special support for core themes and the Cover block were able to be removed, and cases in other themes/plugins should now more often work out of the box. The overall CSS is also reduced. (#5955, #6028)@-moz-document url-prefix()
Firefox CSS hack into @supports (-moz-appearance:meterbar)
. (#5801, #5998)</style>
as <\/style>
in parsed (external) stylesheets. (#5937)wp amp optimizer
WP-CLI command. (Experimental) The AMP Optimizer from amp-toolbox-php is bundled with the AMP plugin and its CLI interface is now accessible via WP-CLI. New commands include wp amp optimizer optimize
, wp amp optimizer transformer list
, and wp amp optimizer transformer config
. See pull request for details. (#6053, #6063, #6064, #6065, https://github.com/ampproject/amp-toolbox-php/pull/150, https://github.com/ampproject/amp-toolbox-php/pull/92, https://github.com/ampproject/amp-toolbox-php/pull/139, #6116)width=device-width
. (#5894, #5903)rel="nofollow noreferrer noopener"
to amp-wp.org link in form submission message. (#6076, #6082)noloading
attribute or what AMP layout
should be applied for a given block. These were just confusing for users and were not helpful, especially since they didn't apply to the non-AMP version of the page (which will no longer necessarily be the case with Bento AMP). For this reason, those settings as well as fit-text and AMP-specific blocks have been deprecated or removed. These features make more sense in ecosystem plugins; for example instead of an amp-mathml
block, users should rather use the AMP-compatible MathML Block plugin. Not all AMP-specific settings have been removed, for example the carousels or lightboxes on galleries, but they'll be revisited at a later date. Users of the editor should not need to know anything about AMP and they needn't see "AMP" mentioned anywhere unless they want those technical details. (#4554, #4555, #4556, #5575, #5573, #5574, #4557, #5729)amp_post_template_add_analytics_script()
. (#5722)Thanks to the many contributors who made this release possible through work on development, design, testing, project management, and more:
Adam Silverstein (@adamsilverstein), Alain Schlesser (@schlessera), Alberto A. Medina (@amedina), Artem Russakovskii (@archon810), @dikeii, eD! Thomas (@edequalsawesome), @hasanbahtiar, Ikem (@inaikem), Jason (@jauyong), John Watkins (@johnwatkins0), Joshua Wold (@jwold), Junior Miranda (@juniormiranda89), Kasper Myram (@kmyram), Kristofer Baxter (@kristoferbaxter), @maciejmackowiak, @MackenzieHartung, Marco Ferrari (@marco-msg-ferrari), @martn234, Mike Kormendy (@mkormendy), Milind More (@milindmore22), @ospira, Pascal Birchler (@swissspidy), Pierre Gordon (@pierlon), Piotr Delawski (@delawski), Pradeep Sonawane (@pradeep910), Raja Anbazhagan (@raja-anbazhagan), @ravau, Ryan Kienstra (@kienstra), Sebastian Benz (@sebastianbenz), Weston Ruter (@westonruter)
Now available to install via WordPress.org.
You can also install the amp.zip
build linked below by uploading it in the WordPress admin.
To install as a Git submodule, consider 2.1.0-built.
This is the second release candidate for v2.1, after the first beta, second beta, and first release candidate. For the full list of changes coming in this release, see the previous prerelease changelogs, as well as the exhaustive list in the 2.1 milestone. The 2.1.0 final release is due on May 6th.
On top of the changes in the previous prereleases, this prerelease includes 1 closed issue and 4 merged pull requests. Please report any issues you encounter while testing!
The changes included are minor:
page_for_posts
from interfering with hero image candidate identification. https://github.com/ampproject/amp-wp/pull/6168
You can also install the amp.zip
build linked below by uploading it in the WordPress admin.
For up-to-the-minute builds, see the Development Builds Wiki page.
This is the first release candidate for v2.1, after the first beta and second beta. For the full list of changes coming in this release, see the previous prerelease changelogs, as well as the exhaustive list in the 2.1 milestone. We were originally going to release 2.1 on the WordPress plugin directory by the end of April, but due to a couple bugs discovered during QA for the release candidate, 2.1 will be released the first week of May.
On top of the changes in the first and second betas, this prerelease includes 10 closed issues and 20 merged pull requests (excluding Dependabot updates). Please report any issues you encounter while testing!
The key changes since the second beta include:
editor-color-palette
theme support), these predefined colors would be entirely absent when you viewed an AMP page in Reader mode—both for AMP Legacy templates and Reader themes. Styles were likewise missing for gradient presets (editor-gradient-presets
) and font sizes (editor-font-sizes
). This has now been fixed. All styles for these theme support features are now dynamically generated in PHP for inclusion on AMP pages. On the AMP Legacy templates, where the primary theme context is present, the theme support features are pulled straight from get_theme_support()
. When a Reader theme is active, however, the primary active theme's support features are not registered in memory; in this case, the active theme's support features are stored in an option so that they can then be available when the plugin switches to another theme for serving AMP pages in Reader mode. https://github.com/ampproject/amp-wp/issues/5229, https://github.com/ampproject/amp-wp/pull/6042
object[type=application/pdf]
element will be automatically converted into an amp-google-document-embed
element. https://github.com/ampproject/amp-wp/issues/6083, https://github.com/ampproject/amp-wp/pull/6112
amp-bind
. A new transformer has been added to the Optimizer which improves performance of amp-bind
by making it faster to locate the elements that have bound attributes when server-side rendering is enabled (as it is by default). https://github.com/ampproject/amp-wp/pull/6117, https://github.com/ampproject/amp-toolbox-php/issues/84, https://github.com/ampproject/amp-toolbox-php/pull/162
amp
to something else like lite
, you can do so either via the amp_query_var
filter or via the (deprecated) AMP_QUERY_VAR
constant. In early versions of the AMP plugin, this customization was commonly done in the theme. However, this happens much too late for the AMP plugin to be able to switch to a Reader theme or now to properly route paired AMP requests. Instead of limiting the user to the AMP Legacy theme and the ?amp=1
paired URL structure, when the query var is defined late it is now cached in an option so that it can be made available early in WordPress's execution (at plugins_loaded
). Since such late-defined slugs are still not ideal, a new Site Health check will recommend that you move it from the theme to a plugin. https://github.com/ampproject/amp-wp/pull/6125
The amp-toolbox-php package was updated to include changes from the 0.5.0 milestone.
Also merged since the second beta is the a new QA Tester Plugin which can be installed to greatly facilitate switching between prereleases and builds for unmerged pull requests.
You can also install the amp.zip
build linked below by uploading it in the WordPress admin.
For up-to-the-minute builds, see the Development Builds Wiki page.