How to set up WordPress to use Google's AMP?

Why speed matters

If like billions of us you’ve recently consumed web content on a mobile device, you noticed the experience could be improved. Reading news articles is often painfully slow, with pages taking a long time to load. Even after text loads on page, pages continue loading over many seconds, as ads, tracking javascript and images get downloaded.

Mobile apps have gotten us used to fast loading content, offline viewing and fast interfaces. But mobile sites often lag behind, literally. This is particularly true for news and blog sites, which make use of many widgets for ads, analytics, sharing and commenting. You can test this easily by installing a content blocker on an iOS device and noticing the speed increase.

What if you could build an app with your WordPress website? MobiLoud makes it easy with a complete app building service. Learn more about how you could easily publish your own native apps.
Sure, you can use a responsive theme to alleviate some of the problems, but responsive design doesn’t deal with page load performance. Most times, responsive is at the root of the problem: we design websites able to fit on displays of many different resolutions and we fail to create an experience optimised for the smallest displays, lower CPU performance and the slowest connections. With responsive design, all desktop assets and functionality will still load when the page is rendered on mobile, often resulting in poor performance. According to Facebook, the average loading time of a news article on mobile is 8 seconds.

While some of us are lucky enough to have 3G or 4G network connections on our smartphones, you just need to get out of urban centers for network speeds to drop dramatically. And of course there’s the “next billion” people and devices connecting from developing countries where fast network connections are just not available yet.

Fortunately, things are moving in the right direction, with all of the big players working on ways to speed up content loading on mobile devices. Facebook launched Instant Articles, a solution for fast loading web content, though one limited to their walled garden. Apple has launched its own News app. Google launched AMP (Accelerated Mobile Pages), an initiative with a similar purpose as Facebook’s but an open standard approach.

WordPress recently announced they added support for Google’s Accelerated Mobile Pages (AMP) to WordPress.com and to WordPress.org sites in the form of a free plugin.

So let’s see how you can add AMP to your WordPress.org blog or news site and benefit from the latest tech to speed up your website on mobile devices.


What is Google AMP

Google’s AMP promise is to make your pages load instantly on mobile devices. It fixes one of the last remaining problems with mobile internet. Despite everyone using it, mobile internet is surprising slow. AMP gets around this by restricting the number features on a page, stripping out design features for speed. Google has claimed that AMP’s loading speed is 85 percent faster than regular web pages.

AMP creates a special mobile view for your website. This new mobile site enhances your content for supported clients such as Google mobile search and Chrome. This new view is in addition to the the regular and mobile websites you already have. Under this view, your pages look like normal web pages but with all but the content stripped away. Because of this, you need to make sure your WordPress site is ready for it

How Does AMP work?

AMP HTML is essentially subset of HTML with only specific JavaScript elements allowed. The focus is on speeding up loading for content heavy sites such as news sites and blogs. While it limits Javascript heavily, it does allow specific Analytics and Advertising elements on your pages, making it a good option for news publishers.

To create its new mobile view, AMP uses three main elements:

AMP HTML – This subset of HTML adds some custom tags and properties with many restrictions that allow AMP clients to render your content the way you want it without worrying about performance. The plugin adds these new tags to your pages automatically, but you can use them in your own AMP-specific templates if you need them.
AMP JS – This JavaScript framework was made for mobile pages that manages the resource handling and asynchronous loading that make the AMP process work. Please note, you cannot use any third-party JavaScript on your AMP pages.
AMP CDN – AMP provides an optional content delivery network that can cache and optimize your AMP pages further.
 
First of all, you have to install the plugin before you can use AMP on your WordPress site. If you’re using WordPress.com, this is already available to you. You just need to search for amp-wp in the “Add New” section of your Plugins WordPress admin panel. You then simply click install and then activate to start using AMP on your website.
 
Back
Top