Home > CMS Tutorial > WordPress > body text

Learn how to enable WordPress for google AMP

藏色散人
Release: 2021-07-16 17:21:09
forward
2568 people have browsed it

1. About AMP

In the era of mobile Internet, although the responsive design of the website can satisfy multiple screens (pc, mobile phone, iPad, etc.) Browsing, but Google launched a technology for faster mobile page access in October 2015 - Accelerated Mobile Pages (AMP accelerated mobile pages). AMP pages greatly simplify mobile pages and are designed to increase the access speed to mobile pages. AMP The characteristics are as follows:

  1. AMP's HTML code is a subset of standard HTML, which greatly simplifies the html code. Some Html codes will no longer be applicable, such as table, frame, etc.
  2. Greatly simplifies CSS, and it can only be written in HTML and cannot call external CSS files.
  3. Most functions of JS are no longer available, but many interactive functions are also gone. Although rich interactions are affected, the speed is improved.
  4. Strengthen the control of page resources, such as pictures, videos, etc., and then load them when the user scrolls down to the picture.
  5. Taking full advantage of caching, Google caches AMP pages on its own servers.

For more information about AMP, please refer to the link below:

  1. AMP official website: https://www.ampproject.org
  2. AMP's Roadmap: https://amp.dev/community/roadmap/?referrer=ampproject.org

When AMP was first launched, it was limited to news pages. In August 2016, Google announced that AMP would be used for all types of mobile pages. At present, although Google has made it clear that AMP pages will not affect rankings, Google has spared no effort to promote AMP. There is no guarantee that AMP will not be considered in the algorithm in the future.

2. Let WordPress support AMP

AMP is very suitable for news, blogs and other information websites. As a veteran blog system, WordPress launched the official plug-in of AMP on October 6, 2016. At present, this plug-in greatly simplifies the article page. The article AMP page removes navigation, comments, etc., and only retains the article content itself. This page is also compatible with desktop computers (PC) for browsing, including homepage, categories, page turning, etc. There is no corresponding AMP page. I predict that more functions will be added in subsequent versions. If you don’t want to wait, you can directly modify this plug-in to add navigation, classification and other functions.

After installing and starting the AMP plug-in for WordPress, the plug-in will create an AMP article page. The link URL of this page is the link URL of the original page plus "/amp". Take the link of this blog article as an example:

Original article page link: //www.watch-life.net/wordpress/wordpress-google-amp.html ‎

AMP page link: //www.watch-life.net/wordpress /wordpress-google-amp.html/amp

In order for Google’s search engine to retrieve the AMP page, the address of the AMP page needs to be specified in the HTML of the original article page, that is, use the amphtml tag to specify the AMP version address:

<link>
Copy after login
Copy after login

In the HTML code of the AMP page, you must also use the canonical tag to indicate the original article page address:

<link>
Copy after login
Copy after login

AMP page is displayed on the PC side

Learn how to enable WordPress for google AMP

Display of AMP page on mobile phone

Learn how to enable WordPress for google AMP

##3.Display of AMP page in Google search

After the AMP page is indexed by Google search, it will be displayed in the search results When I see an AMP page, there is a lightning mark and the word AMP at the beginning of the page description. After the user clicks, the page will open quickly, showing the cached page on the Google server. The AMP page in Google search is shown as follows:


Learn how to enable WordPress for google AMP

4. Will Baidu follow up on AMP?

Domestic webmasters are most concerned about whether Baidu search will follow up on AMP? The good news is that Baidu also supports something similar to AMP. The bad news is that Baidu launched its own set of similar AMP-Mobile Instant Pages (MIP mobile web accelerator) in August 2016. AMP and MIP are very similar, whether it is HTML, CSS, or disabling large Part of the JS, resource control, caching, etc. are almost similar to AMP, and the mutual reference method (adding tags) between the original page and the MIP page is the same as Google AMP. The page layout, menu arrangement, and technical description of the official website are almost the same. We were also surprised to see that Baidu's MIP basically copied AMP. Then why doesn’t Baidu use AMP like Google? Moreover, AMP is open source. I think an important reason is that AMP needs to call the JS library of the official website to control resource loading, caching and other functions:

<script></script>
Copy after login
This is probably a core reason why Baidu is unwilling to adopt AMP. In view of the domestic The network environment (great qiang) inevitably makes people worry that this js library will be blocked that day. There is currently no WordPress plug-in for MIP. If WordPress adopts MIP, the only way is to change the theme template. The most troublesome thing about this method is that it requires separately enabling a second-level domain name for the MIP page. I don’t plan to follow up yet. , I feel that this method is not as simple and fast as plug-in.

For more WordPress technical articles, please visit the WordPress tutorial column!

The above is the detailed content of Learn how to enable WordPress for google AMP. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:segmentfault.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!