search
HomeCMS TutorialWordPressLearn how to enable WordPress for google AMP

Learn how to enable WordPress for google AMP

Jul 16, 2021 pm 05:20 PM
googlephpwordpress

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>

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

<link>

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>
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
This article is reproduced at:segmentfault. If there is any infringement, please contact admin@php.cn delete
Is WordPress suitable for e-commerce?Is WordPress suitable for e-commerce?May 13, 2025 am 12:05 AM

Yes, WordPress is very suitable for e-commerce. 1) With the WooCommerce plugin, WordPress can quickly become a fully functional online store. 2) Pay attention to performance optimization and security, and regular updates and use of caches and security plug-ins are the key. 3) WordPress provides a wealth of customization options to improve user experience and significantly optimize SEO.

How to add your WordPress site in Yandex Webmaster ToolsHow to add your WordPress site in Yandex Webmaster ToolsMay 12, 2025 pm 09:06 PM

Do you want to connect your website to Yandex Webmaster Tools? Webmaster tools such as Google Search Console, Bing and Yandex can help you optimize your website, monitor traffic, manage robots.txt, check for website errors, and more. In this article, we will share how to add your WordPress website to the Yandex Webmaster Tool to monitor your search engine traffic. What is Yandex? Yandex is a popular search engine based in Russia, similar to Google and Bing. You can excel in Yandex

How to fix HTTP image upload errors in WordPress (simple)How to fix HTTP image upload errors in WordPress (simple)May 12, 2025 pm 09:03 PM

Do you need to fix HTTP image upload errors in WordPress? This error can be particularly frustrating when you create content in WordPress. This usually happens when you upload images or other files to your CMS using the built-in WordPress media library. In this article, we will show you how to easily fix HTTP image upload errors in WordPress. What is the reason for HTTP errors during WordPress media uploading? When you try to upload files to Wo using WordPress media uploader

How to fix the issue where adding media buttons don't work in WordPressHow to fix the issue where adding media buttons don't work in WordPressMay 12, 2025 pm 09:00 PM

Recently, one of our readers reported that the Add Media button on their WordPress site suddenly stopped working. This classic editor problem does not show any errors or warnings, which makes the user unaware why their "Add Media" button does not work. In this article, we will show you how to easily fix the Add Media button in WordPress that doesn't work. What causes WordPress "Add Media" button to stop working? If you are still using the old classic WordPress editor, the Add Media button allows you to insert images, videos, and more into your blog post.

How to set, get and delete WordPress cookies (like a professional)How to set, get and delete WordPress cookies (like a professional)May 12, 2025 pm 08:57 PM

Do you want to know how to use cookies on your WordPress website? Cookies are useful tools for storing temporary information in users’ browsers. You can use this information to enhance the user experience through personalization and behavioral targeting. In this ultimate guide, we will show you how to set, get, and delete WordPresscookies like a professional. Note: This is an advanced tutorial. It requires you to be proficient in HTML, CSS, WordPress websites and PHP. What are cookies? Cookies are created and stored when users visit websites.

How to Fix WordPress 429 Too Many Request ErrorsHow to Fix WordPress 429 Too Many Request ErrorsMay 12, 2025 pm 08:54 PM

Do you see the "429 too many requests" error on your WordPress website? This error message means that the user is sending too many HTTP requests to the server of your website. This error can be very frustrating because it is difficult to find out what causes the error. In this article, we will show you how to easily fix the "WordPress429TooManyRequests" error. What causes too many requests for WordPress429? The most common cause of the "429TooManyRequests" error is that the user, bot, or script attempts to go to the website

How scalable is WordPress as a CMS for large websites?How scalable is WordPress as a CMS for large websites?May 12, 2025 am 12:08 AM

WordPresscanhandlelargewebsiteswithcarefulplanningandoptimization.1)Usecachingtoreduceserverload.2)Optimizeyourdatabaseregularly.3)ImplementaCDNtodistributecontent.4)Vetpluginsandthemestoavoidconflicts.5)ConsidermanagedWordPresshostingforenhancedperf

How customizable is WordPress, really?How customizable is WordPress, really?May 11, 2025 am 12:11 AM

WordPress is very customized, providing a wide range of flexibility and customizability. 1) Through the theme and plug-in ecosystem, 2) use RESTAPI for front-end development, 3) In-depth code level modifications, users can achieve a highly personalized experience. However, customization requires mastering technologies such as PHP, JavaScript, CSS, etc., and pay attention to performance optimization and plug-in selection to avoid potential problems.

See all articles

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

Hot Tools

ZendStudio 13.5.1 Mac

ZendStudio 13.5.1 Mac

Powerful PHP integrated development environment

SecLists

SecLists

SecLists is the ultimate security tester's companion. It is a collection of various types of lists that are frequently used during security assessments, all in one place. SecLists helps make security testing more efficient and productive by conveniently providing all the lists a security tester might need. List types include usernames, passwords, URLs, fuzzing payloads, sensitive data patterns, web shells, and more. The tester can simply pull this repository onto a new test machine and he will have access to every type of list he needs.

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

MinGW - Minimalist GNU for Windows

MinGW - Minimalist GNU for Windows

This project is in the process of being migrated to osdn.net/projects/mingw, you can continue to follow us there. MinGW: A native Windows port of the GNU Compiler Collection (GCC), freely distributable import libraries and header files for building native Windows applications; includes extensions to the MSVC runtime to support C99 functionality. All MinGW software can run on 64-bit Windows platforms.

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor