Add Google Adsense Ads on AMP Pages

Ads on AMP Pages

Google has released Google Adsense auto Ads and also Auto Ads on AMP Pages in this post you’ll learn how to add Ads in AMP Pages or AdSense amp auto ads in WordPress.

Well, there are a lot of WordPress Plugins, in WordPress Directory which lets you insert Ads into AMP Pages or enable AMP Ads.

Plugins like AMP for WP provides that feature but charge you around $30 extra in the name of extensions to add Ads on AMP Pages between paragraphs, if you need to insert Ads in between paragraphs of your blog post.

Enable Adsense Auto Ads on AMP Pages

Now you can use Googles latest feature Ads on AMP Pages or Auto Ads for AMP to add ads on AMP Pages in Between the Posts and paragraphs for this you need two code snippets which google provide below is step how to get those Ad code snippets. If you don’t have a WordPress blog.

Auto ads for AMP

Auto ads for AMP Pages

Google might take around 20 minutes to automatically optimize and show ads on your AMP pages (it takes less than 20 mins 🙂 ).

Now that you have got these ad codes, follow the steps mentioned below will help you save Money and get most of Adsense without compromising with AMP.

Enable Adsense Ads on AMP Pages for AMP for WP Plugin.

If you’re using AMP for WP you can directly implement it through your WP Dashboard, and its the easiest and recommended way.

Now just hover the mouse over or click on the AMP icon in the sidebar as shown in below picture. and click on Settings

Auto ads for AMP for WP

After you click on Setting you’ll see something like below image now click on the Advance Setting, now scroll down and you’ll find Head and Body section.

Now copy the ad code from Adsense Dashboard and paste it to their respective places i.e Header code in header and Body code in Body.

Now you’ll see ads appearing in the posts and these ad positions are dynamic google will place the ads according to the user.

Auto Ads for AMP for WP

Cheers, now you have finished implementing ads in Posts.

Enable Adsense Ads on AMP Pages for AMP for WordPress Plugin.

As if you’re using AMP for WordPress Plugin its bit tricky to implement Ads on AMP Pages, but its very easy to add Ads on AMP Pages running on AMP for WordPress Plugin follow the below steps.

Note: Its always a good Practice to make the backup of your site while editing Themes, Plugins, etc.

How to insert Adsense Ads on AMP Pages Manually in WordPress AMP Plugin?

First, read the right way to customize a plugin then proceed.

Navigate to ‘html-start.php’ file through FTP/SFTP inside AMP Plugin folder like the way it is shown in this image, or you can access via Cpanel File Manager. Though you can implement this using Headers and Footers WordPress Plugin, it’s better to add it manually I have noticed malfunction and it doesn’t work properly in case of the plugin.

how to show ads on amp pages
Place code’s in the Marked Places

As I mentioned you can do this way but I recommend using the below method which is more helpful and it’s very easy to implement.

Best way to insert code snippets WordPress AMP Pages

Here we will use hooks, header action hook as amp_post_template_head & footer action hook as amp_post_template_footer. Make sure you use a child theme.

Replace //Your Header/Body code with AMP Ad’s Header/Body Code in the code below

Similarly, add the snippet below to your theme’s functions.php

By completing this step and save the functions.php file and now you’ll be able to see Ads on AMP Pages.

Leave a Reply

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Add Google Adsense Ads on AMP Pages

by Ashish Yadav time to read: 3 min
0