How to Add Google Adsense Ads in WordPress AMP Pages

Add Google Adsense Ads in WordPress AMP Pages. Adding Google adsense ads in WordPress Amp pages to show when a visitor visits AMP page of your website is easy.

Google Adsense Ads in WordPress AMP Pages
Google Adsense Ads in WordPress AMP Pages

WordPress powers More than 70% of the world blogs, And AMP pages is the newest trend.

AMP basically means Accelerated Mobile Pages, which improves the user experience on slow internet devices.

Must Read- How can you create Flipkart like E commerce website yourself and earn money.

Most of the Bloggers use Google Adsense to monetize their blogs. 90 % of the WordPress users show adsense ads using WordPress plugins to display their ads.

Till now there is no free WordPress plugin which will show the Google Adsense ads in WordPress AMP pages. You need to pay for the plugins.

But we have a simple stepwise guide that will make you include the Google Ads in WordPress AMP pages.

Stepwise guide to Show / Add Google Adsense Ads in WordPress AMP pages

  1. Login to your WordPress Blog Dashboard and navigate to the Plugin Editor Section.
  2. Select the AMP plugin. It is the same plugin which you are using to create AMP version of your site.
  3. Open Single.PHP which is available at – amp/templates/single.php.
  4. Search <div class=”amp-wp-content”> line and enter the Adsense AMP formatted code.
  5. To add AMP ads in footer, Find do_action( ‘amp_post_template_footer’, $this ) and enter the second Google Ad code.
  6. That’s it. Save the file.

Creating AMP format Google Adsense Code to Show Google Adsense Ads in WordPress AMP pages

  1. Identify/Create Google Adsense Regular ad which you have to include in AMP pages

    Once you have the Google Ad Code, it will be something like –

    <script async src=”//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js”></script><ins class=”adsbygoogle”style=”display:inline-block;width:336px;height:280px”data-ad-client=”ca-pub-95675557XXXXXXXX”data-ad-slot=”170XXXXXXX”></ins><script>(adsbygoogle = window.adsbygoogle || []).push({});</script>

  2. Converting Regular Ad code to AMP compatible Ad Code

    You have to just use the CA – PUB id and the DATA AD SLOT ID. So, the above code will be something like –

    <amp-ad width=350 height=100type=”adsense”data-ad-client=”ca-pub-95675557XXXXXXXX”data-ad-slot=”170XXXXXXX”></amp-ad>

So enjoy and earn more with this Ad integration strategy.

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top