Skip to content
Enable AMP on your WordPress site, the WordPress way.
Branch: develop
Clone or download
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
assets Merge pull request #2036 from ampproject/fix/image-stretching Apr 4, 2019
back-compat Revert changes to legacy 0.3 templates since obsolete Apr 5, 2019
bin Bump stable tag to 1.1.1 and update release instrictions Apr 23, 2019
blocks Remove 'type' from attributes where source is set. Nov 17, 2018
includes Prevent wp_targeted_link_rel() from corrupting JSON in amp_validation… Apr 22, 2019
patches
templates Always include amp-wp-canonical-link style in customizer preview Apr 6, 2019
tests
wp-assets Update screenshots and squooshify Apr 6, 2019
wpcom Short-circuit polldaddy shortcode when no poll or survey supplied Nov 16, 2018
.babelrc
.dev-lib Add tests for AMP integration with PWA plugin Apr 3, 2019
.editorconfig Add .editorconfig file Aug 13, 2018
.eslintignore
.eslintrc Merge branch 'develop' of github.com:ampproject/amp-wp into add/servi… Mar 11, 2019
.gitignore Clean compiled files and do so before building Mar 7, 2019
.gitmodules Replace dev-lib submodule with composer installation Jan 17, 2019
.travis.yml Remove redundant composer install Jan 18, 2019
Gruntfile.js Clean compiled files and do so before building Mar 7, 2019
LICENSE
amp.php Bump version to 1.2-alpha Apr 16, 2019
code_of_conduct.md Rename CODE_OF_CONDUCT.md to code_of_conduct.md for consistency Feb 6, 2019
composer.json Update dependency xwp/wp-dev-lib to v1.1.1 Apr 11, 2019
composer.lock
contributing.md
jetpack-helper.php
package-lock.json Update dependency webpack-cli to v3.3.1 Apr 21, 2019
package.json Update dependency webpack-cli to v3.3.1 Apr 21, 2019
phpcs.xml
phpunit.xml Add tests for AMP integration with PWA plugin Apr 3, 2019
readme.md Bump stable tag to 1.1.1 and update release instrictions Apr 23, 2019
readme.txt Bump stable tag to 1.1.1 and update release instrictions Apr 23, 2019
renovate.json
security.md Add security.md Feb 6, 2019
webpack.config.js Move wp-i18n and wp-dom-ready into src directory Jan 17, 2019
wpcom-helper.php Update project name to ampproject/amp-wp Dec 6, 2018

readme.md

AMP Plugin for WordPress

Banner Enable AMP on your WordPress site, the WordPress way.

Contributors: automattic, xwp, google, westonruter, ryankienstra, batmoo, stubgo, albertomedina, tweetythierry, joshuawold, postphotos
Tags: amp, mobile
Requires at least: 4.9
Tested up to: 5.1
Stable tag: 1.1.1
License: GPLv2 or later
Requires PHP: 5.4

Build Status Built with Grunt

Description

The AMP Project is an open-source initiative aiming to make the web better for all. AMP enables web experiences that are consistently fast, beautiful and high-performing across distribution platforms. The Official AMP Plugin for WordPress supports fully integrated AMP publishing for WordPress sites, with robust capabilities and granular publisher controls.

Features and capabilities provided by the plugin include:

  • Compatibility Tool: to assist the development of AMP experiences by enabling AMP debugging with detailed information about validation errors that may exist, the markup/scripts causing them, and the specific components on site (e.g theme, plugin, core) responsible for that page content.
  • CSS Tree Shaking: to assist in dealing with cases where the defined CSS rules on a site exceed the CSS size limit allowed on single AMP pages.
  • Core Theme Support: enabling full AMP validity for four default themes (i.e. Twenty Fifteen, Twenty Sixteen, Twenty Seventeen, Twenty Nineteen).
  • Gutenberg Support: enabling AMP content creation fully integrated with Gutenberg.
  • AMP-first Experiences support: enabling full-site AMP experiences without sacrificing the flexibility of the platform, or the fidelity of content.
  • Many Optimizations: A myriad of code, performance, and developer experience improvements: from customization flexibility, to better UI flows, internationalization, accessibility, etc.

The plugin can be configured to follow one of three different template modes: Native, Transitional, and Reader. When configured to operate in Reader and Transitional modes, a given post/page will have a canonical URL as well as a corresponding (paired) AMP URL. The AMP plugin is not serving as a mobile theme; it does not redirect mobile devices to the AMP version. Instead, the AMP version is served to mobile visitors when they find the content on platforms such as Twitter, Pinterest, Google Search, and others.

With the official AMP plugin for WordPress, the WordPress ecosystem is provided with the capabilities and tools it needs to build world-class AMP experiences without deviating from its standard, flexible, and well-known content creation workflow.

Installation

  1. Upload the folder to the /wp-content/plugins/ directory.
  2. Activate the plugin through the 'Plugins' menu in WordPress.
  3. If you currently use older versions of the plugin in Reader mode, it is strongly encouraged to migrate to Transitional or Native mode. Depending on your theme/plugins, some development work may be required.

Getting Started

To learn more about the plugin and start leveraging its capabilities to power your AMP content creation workflow check the official AMP plugin product site.

If you are a developer, we encourage you to follow along or contribute to the development of this plugin on GitHub.

Screenshots

Theme support enables you to reuse the active theme's templates and stylesheets; all WordPress features (menus, widgets, comments) are available in AMP.

Theme support enables you to reuse the active theme's templates and stylesheets; all WordPress features (menus, widgets, comments) are available in AMP.

Many themes can be served as AMP without any changes; the default experience is as if JavaScript is turned off in the browser since scripts are removed.

Many themes can be served as AMP without any changes; the default experience is as if JavaScript is turned off in the browser since scripts are removed.

Reader mode templates are still available, but they are are limited. Not only do they differ from the active theme, any validation errors are silently sanitized.

Reader mode templates are still available, but they are are limited. Not only do they differ from the active theme, any validation errors are silently sanitized.

Switch from Reader mode to Transitional or Native mode in AMP settings screen. You may need to disable the admin bar in AMP if your theme has a larger amount of CSS.

Switch from Reader mode to Transitional or Native mode in AMP settings screen. You may need to disable the admin bar in AMP if your theme has a larger amount of CSS.

Make the entire site available in AMP or pick specific post types and templates; you can also opt-out on per-post basis.

Make the entire site available in AMP or pick specific post types and templates; you can also opt-out on per-post basis.

Plugin checks for AMP validity and will indicate when either: no issues are found, new issues need moderation, or issues block AMP from being served.

Plugin checks for AMP validity and will indicate when either: no issues are found, new issues need moderation, or issues block AMP from being served.

The editor will surface validation issues during content authoring. The specific blocks with validation errors are indicated.

The editor will surface validation issues during content authoring. The specific blocks with validation errors are indicated.

Validated URLs include the list of validation errors encountered, giving control over whether sanitization for a validation error is accepted or rejected.

Validated URLs include the list of validation errors encountered, giving control over whether sanitization for a validation error is accepted or rejected.

Styles added by themes and plugins are automatically concatenated, minified, and tree-shaken to try to keep the total under 50KB of inline CSS.

Styles added by themes and plugins are automatically concatenated, minified, and tree-shaken to try to keep the total under 50KB of inline CSS.

A WP-CLI command is provided to check the URLs on a site for AMP validity. Results are available in the admin for inspection.

A WP-CLI command is provided to check the URLs on a site for AMP validity. Results are available in the admin for inspection.

Changelog

For the plugin’s changelog, please see the Releases page on GitHub.

You can’t perform that action at this time.