How to Manually Add Adsense Code to AMP Pages ? 100% Working

0 79

Recently Google Start’s AMP Pages for all websites . Mainly it’s Developed for News Websites for Better Instant Results in Google Search and Render with low data size so , it ultimate load with in fraction of seconds in smart phones . So Based on the website we need to enable this plugin. Actually Automattic, Inc Already releases an official plugin for All WordPress Based websites. You can Access that Official Plugin WordPress AMP  through  WordPress plugin directory and activate it.

Next 5 minutes I will guide you. just follow these Steps

[wpsm_numhead num=”1″ style=”3″ heading=”2″]Install AMP Plugin[/wpsm_numhead]

Here You Need to Install AMP Plugin from WordPress Plugin Directory or Here , and Activate it .

[wpsm_numhead num=”2″ style=”3″ heading=”2″]Go to FTP of Your website[/wpsm_numhead]

Then You may go to Cpanel ==> File Manager  (or) FTP of your Website . you can access FTP via any Freeware Software like FileZilla or CoreFTP or Any Other .

Then Navigate to wp-content/plugin/amp/templets/ directory 

[wpsm_numhead num=”3″ style=”3″ heading=”2″]EDIT Single.php File[/wpsm_numhead]

Then Select single.php file and Edit it With Code Editor or Any Text Editor

[wpsm_box type=”warning” float=”none” text_align=”left”]
Make Sure that You Need to Place Adsense Code in Correct Manner, otherwise you will get Error
[/wpsm_box]

then Copy The Following code from here

<!--ADSENSE AD SLOT--> 
 <div id="ad1top1medium"> 
 <amp-ad width=300 height=250 
 type="adsense" 
 data-ad-client="ca-pub-XXXXXXXXXXXXXX" // Replace with your Adsense Publisher id
 data-ad-slot="XXXXXXXXXXX"> // Replace with your Ad slot id
 </amp-ad> 
 </div><div class="clear"></div> 
<!--ADSENSE AD SLOT-->

[wpsm_numhead num=”4″ style=”3″ heading=”2″]Modify Adsense Data Values[/wpsm_numhead]

Then Modify Adsense Data like [adinserter block=”1″]

data-ad-client="ca-pub-XXXXXXXXXXXXXX" // Replace with your Adsense Publisher id

and Also
 data-ad-slot="XXXXXXXXXXX"> // Replace with your Ad slot id

[wpsm_numhead num=”5″ style=”3″ heading=”2″]Update Code in Single.php[/wpsm_numhead]

Copy Entire Modified code and pate in single.php ,

just after <div class=”amp-wp-content”>

then save it . Finish

May be future maximum number of website will going to upgrade with AMP . So i hope you can understand , if you face any dificulties during the process please let me know via comment box  , i will help you on that . and if you already implemented on your website please share your experience with  ShinyStartup Readers , How AMP impact on your Website…. ? let me know….

You might also like More from author