Table of Contents
1. About AMP
2. Let WordPress support AMP
Home CMS Tutorial WordPress Learn how to enable WordPress for google AMP

Learn how to enable WordPress for google AMP

Jul 16, 2021 pm 05:20 PM
google php wordpress

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!

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

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Roblox: Bubble Gum Simulator Infinity - How To Get And Use Royal Keys
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Nordhold: Fusion System, Explained
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Mandragora: Whispers Of The Witch Tree - How To Unlock The Grappling Hook
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Hot Topics

Java Tutorial
1666
14
PHP Tutorial
1273
29
C# Tutorial
1252
24
How to adjust the wordpress article list How to adjust the wordpress article list Apr 20, 2025 am 10:48 AM

There are four ways to adjust the WordPress article list: use theme options, use plugins (such as Post Types Order, WP Post List, Boxy Stuff), use code (add settings in the functions.php file), or modify the WordPress database directly.

How to build a website for wordpress host How to build a website for wordpress host Apr 20, 2025 am 11:12 AM

To build a website using WordPress hosting, you need to: select a reliable hosting provider. Buy a domain name. Set up a WordPress hosting account. Select a topic. Add pages and articles. Install the plug-in. Customize your website. Publish your website.

The Compatibility of IIS and PHP: A Deep Dive The Compatibility of IIS and PHP: A Deep Dive Apr 22, 2025 am 12:01 AM

IIS and PHP are compatible and are implemented through FastCGI. 1.IIS forwards the .php file request to the FastCGI module through the configuration file. 2. The FastCGI module starts the PHP process to process requests to improve performance and stability. 3. In actual applications, you need to pay attention to configuration details, error debugging and performance optimization.

How to import the source code of wordpress How to import the source code of wordpress Apr 20, 2025 am 11:24 AM

Importing WordPress source code requires the following steps: Create a sub-theme for theme modification. Import the source code and overwrite the files in the sub-topic. Activate the sub-theme to make it effective. Test the changes to make sure everything works.

How to view the front-end of WordPress How to view the front-end of WordPress Apr 20, 2025 am 10:30 AM

You can view the WordPress front-end by logging into the dashboard and switching to the View Sites tab; automate the viewing process with a headless browser; installing the WordPress plugin to preview the front-end within the dashboard; viewing the front-end via a local URL (if WordPress is set locally).

What happens if session_start() is called multiple times? What happens if session_start() is called multiple times? Apr 25, 2025 am 12:06 AM

Multiple calls to session_start() will result in warning messages and possible data overwrites. 1) PHP will issue a warning, prompting that the session has been started. 2) It may cause unexpected overwriting of session data. 3) Use session_status() to check the session status to avoid repeated calls.

How to cancel the editing date of wordpress How to cancel the editing date of wordpress Apr 20, 2025 am 10:54 AM

WordPress editing dates can be canceled in three ways: 1. Install the Enable Post Date Disable plug-in; 2. Add code in the functions.php file; 3. Manually edit the post_modified column in the wp_posts table.

How to write a header of a wordpress How to write a header of a wordpress Apr 20, 2025 pm 12:09 PM

The steps to create a custom header in WordPress are as follows: Edit the theme file "header.php". Add your website name and description. Create a navigation menu. Add a search bar. Save changes and view your custom header.

See all articles