没有不值得去解决的问题,也没有不值得去学习的技术!

Set Up Google AdSense Auto Ads on an AMP Site With WordPress 6

Click Apply, and open: https://www.shuijingwanwq.com/amp/ , Google AdSense Auto ads are now successfully displayed

1. Reference: https://www.shuijingwanwq.com/2023/03/16/7483/ . The AMP website is based on the plugin: Accelerated Mobile Pages

2. Open: https://www.shuijingwanwq.com/amp/ , Google AdSense Auto ads have not yet been set up on the webpage. Reference: https://support.google.com/adsense/answer/9261309 . Set up Auto ads on your AMP site

3. Use the <link> tag to pair non-AMP content with AMP content, making your pages easily discoverable. This preparatory step has already been implemented by the plugin. Add the <link> tag to the <head> of the non-AMP page https://www.shuijingwanwq.com: <link rel=”amphtml” href=”https://www.shuijingwanwq.com/amp/” /> . As shown in Figure 1

Use the <link> tag to pair non-AMP content with AMP content, making your pages easily discoverable. This preparatory step has already been implemented by the plugin. Add the <link> tag to the <head> of the non-AMP page https://www.shuijingwanwq.com: <link rel="amphtml" href="https://www.shuijingwanwq.com/amp/" />
Figure 1

4. This preparatory step has already been implemented by the plugin. Add the <link> tag to the <head> of the AMP page https://www.shuijingwanwq.com/amp/: <link rel=”canonical” href=”https://www.shuijingwanwq.com/”> . As shown in Figure 2

This preparatory step has already been implemented by the plugin. Add the <link> tag to the <head> of the AMP page https://www.shuijingwanwq.com/amp/: <link rel="canonical" href="https://www.shuijingwanwq.com/">
Figure 2

5. On the “AMP Auto ads” page, enable AMP Auto ads. As shown in Figure 3

On the "AMP Auto ads" page, enable AMP Auto ads
Figure 3

6. In the WordPress 6 dashboard under AMP – Settings – Advertisement, turn off Ad Revenue Optimization. As shown in Figure 4

In the WordPress 6 dashboard under AMP - Settings - Advertisement, turn off Ad Revenue Optimization
Figure 4

7. Click to get the AMP code, and place this code on the AMP version of the website. In the WordPress 6 dashboard under AMP – Settings – Advance Settings, paste the code into Enter HTML in Head and Enter HTML in Body (beginning of body tag) respectively. As shown in Figure 5

Click to get the AMP code, and place this code on the AMP version of the website. In the WordPress 6 dashboard under AMP - Settings - Advance Settings, paste the code into Enter HTML in Head and Enter HTML in Body (beginning of body tag) respectively
Figure 5

8. View the source code of https://www.shuijingwanwq.com/amp/ to confirm that the code has been added successfully. As shown in Figure 6

View the source code of https://www.shuijingwanwq.com/amp/ to confirm that the code has been added successfully
Figure 6

9. Click Apply, and open: https://www.shuijingwanwq.com/amp/ , Google AdSense Auto ads are now successfully displayed. As shown in Figure 7

Click Apply, and open: https://www.shuijingwanwq.com/amp/ , Google AdSense Auto ads are now successfully displayed
Figure 7

10. It is recommended to set up Mobile Redirection, so that when https://www.shuijingwanwq.com/ is opened on a mobile device, it automatically redirects to https://www.shuijingwanwq.com/amp/ . In the WordPress 6 dashboard under AMP – Settings – Advance Settings – Mobile Redirection. As shown in Figure 8

It is recommended to set up Mobile Redirection, so that when https://www.shuijingwanwq.com/ is opened on a mobile device, it automatically redirects to https://www.shuijingwanwq.com/amp/ . In the WordPress 6 dashboard under AMP - Settings - Advance Settings - Mobile Redirection
Figure 8

关于作者 · 持续学习与技术实践

我是一名拥有 15 年以上开发经验的技术从业者,自 2013 年起持续运营个人技术博客,记录工作与个人项目中遇到的真实问题,以及解决问题过程中的探索、实践和思考。

除了技术写作,我也在持续开发和维护自己的独立项目,探索新技术和新工具在实际场景中的应用。我始终相信,没有不值得去解决的问题,也没有不值得去学习的技术。

如果这篇文章对你有所帮助,欢迎浏览博客中的其他文章,也欢迎交流技术经验与想法。

关于我  ·  GitHub  ·  邮件联系