Last Updated on May 24, 2021 by Amit
Manually adding Adsense AMP code to each WordPress post can be time consuming and hard to implement the ads. If you are new to WordPress and want to know how to add AMP adsense code using plugin , then this post is for you.
In this article I will show you how to add Adsense code to wordpress AMP pages manually with two simple steps.
I am assuming you are using
AMP for WordPress plugin .
Add Adsense to WordPress AMP plugin
The AMP for WordPress plugin allows us to use 5 ad blocks on different positions in a AMP page . We can add adsense to header, footer, right after body tag, after html heading all these options are available for Adsense on the plugin. You don’t need to add full html adsense code but instead you can just copy Your publisher id and data-ad-slot id from your adsense dashboard and add it to the plugin.
To display ads on AMP pages, go to your WordPress dashboard and click on AMP->Settings menu in the left bottom side.
On the next sub menu, you will see an option Advertisement , click on this option to expend the input fields for adsense
On the next page, you will see some options to add ad from multiple platforms, Toggle the #1 ad button , choose ad type Adsense, Ad size : you can choose any ad size that you like , Data ad client is your publisher id copy it from your adsense dashboard ad unit code, Data ad slot is the slot number of your ad unit copy it from your adsense ad unit code and and finally click on the Responsive ad unit this will make your ad appear responsive on the page . This ignores the ad size and shows the ad in responsive format.
You can add upto 5 ads on a page using this plugin.
If you don’t know how to get Data client id and data Ad-slot , just create a new ad unit on your adsense ads dashboard and copy two lines