Title: Adding AdSense Auto Ad code
Last modified: July 1, 2021

---

# Adding AdSense Auto Ad code

 *  Resolved [RAJDEEP DAS](https://wordpress.org/support/users/linuxrajdeep/)
 * (@linuxrajdeep)
 * [4 years, 11 months ago](https://wordpress.org/support/topic/adding-adsense-auto-ad-code/)
 * How to add Adsense auto ads code in amp version. I am using the Reader Theme 
   AMP Legacy option in this plugin. But not able to find the auto ads adding option.

Viewing 12 replies - 1 through 12 (of 12 total)

 *  [James Osborne](https://wordpress.org/support/users/jamesosborne/)
 * (@jamesosborne)
 * [4 years, 11 months ago](https://wordpress.org/support/topic/adding-adsense-auto-ad-code/#post-14616403)
 * Hi Rajdeep,
 * In order to implement AdSense Auto ads for AMP code on your site have you tried
   the [Site Kit plugin](https://wordpress.org/plugins/google-site-kit/)? Activating
   the AdSense module within Site Kit and allowing the plugin to insert your AdSense
   code will result in Auto ads code on both your AMP and non AMP URLs.
 * If you prefer to insert Auto ads code on your AMP legacy reader theme only, and
   not on your canonical (non AMP) URLs you can use [this mini plugin](https://gist.github.com/westonruter/a41573b932e24810b09949136b9a8445).
 * Let me know if you have any further questions on the above.
    -  This reply was modified 4 years, 11 months ago by [James Osborne](https://wordpress.org/support/users/jamesosborne/).
 *  Thread Starter [RAJDEEP DAS](https://wordpress.org/support/users/linuxrajdeep/)
 * (@linuxrajdeep)
 * [4 years, 11 months ago](https://wordpress.org/support/topic/adding-adsense-auto-ad-code/#post-14616439)
 * I’m not using Sitekit Plugin, any other way?
 *  [Ioanna Iliadi](https://wordpress.org/support/users/ioanna/)
 * (@ioanna)
 * [4 years, 11 months ago](https://wordpress.org/support/topic/adding-adsense-auto-ad-code/#post-14616471)
 * I found this very useful and I managed to add google auto ads in my website
 * [https://websiteforstudents.com/how-to-add-google-adsense-ads-on-wordpress-amp-pages/](https://websiteforstudents.com/how-to-add-google-adsense-ads-on-wordpress-amp-pages/)
 *  [James Osborne](https://wordpress.org/support/users/jamesosborne/)
 * (@jamesosborne)
 * [4 years, 11 months ago](https://wordpress.org/support/topic/adding-adsense-auto-ad-code/#post-14616499)
 * [@linuxrajdeep](https://wordpress.org/support/users/linuxrajdeep/) You can use
   [this mini plugin](https://gist.github.com/westonruter/a41573b932e24810b09949136b9a8445)
   if you prefer to not use Site Kit, with installation steps included within the
   Gist.
 *  Thread Starter [RAJDEEP DAS](https://wordpress.org/support/users/linuxrajdeep/)
 * (@linuxrajdeep)
 * [4 years, 11 months ago](https://wordpress.org/support/topic/adding-adsense-auto-ad-code/#post-14616660)
 * Done. Thanks.
 *  [James Osborne](https://wordpress.org/support/users/jamesosborne/)
 * (@jamesosborne)
 * [4 years, 11 months ago](https://wordpress.org/support/topic/adding-adsense-auto-ad-code/#post-14616718)
 * No problem! Best of luck with your site.
 *  Thread Starter [RAJDEEP DAS](https://wordpress.org/support/users/linuxrajdeep/)
 * (@linuxrajdeep)
 * [4 years, 10 months ago](https://wordpress.org/support/topic/adding-adsense-auto-ad-code/#post-14617961)
 * [@jamesosborne](https://wordpress.org/support/users/jamesosborne/) share the 
   all mini plugins list page url.
 *  [James Osborne](https://wordpress.org/support/users/jamesosborne/)
 * (@jamesosborne)
 * [4 years, 10 months ago](https://wordpress.org/support/topic/adding-adsense-auto-ad-code/#post-14619168)
 * Hi Rajdeep,
 * You’ll find that page below, on the plugin website:
    [https://amp-wp.org/documentation/getting-started/extending-amp-compatibility-extensions-and-mini-plugins/](https://amp-wp.org/documentation/getting-started/extending-amp-compatibility-extensions-and-mini-plugins/)
 *  Thread Starter [RAJDEEP DAS](https://wordpress.org/support/users/linuxrajdeep/)
 * (@linuxrajdeep)
 * [4 years, 10 months ago](https://wordpress.org/support/topic/adding-adsense-auto-ad-code/#post-14647712)
 * Thanks [@jamesosborne](https://wordpress.org/support/users/jamesosborne/)
    One
   more help needed. How to hide this favicon? [https://ibb.co/wsPTmdZ](https://ibb.co/wsPTmdZ)
 *  [James Osborne](https://wordpress.org/support/users/jamesosborne/)
 * (@jamesosborne)
 * [4 years, 10 months ago](https://wordpress.org/support/topic/adding-adsense-auto-ad-code/#post-14651137)
 * Hi Rajdeep,
 * You’ll find instructions on how to remove that programmatically below:
    [https://amp-wp.org/documentation/playbooks/classic-templates/#site-icon](https://amp-wp.org/documentation/playbooks/classic-templates/#site-icon)
 * You’ll need to include that code snippet within a custom plugin or your active
   themes functions.php file – preferably using a child theme so it doesn’t get 
   overwritten.
 * You could also modify the associated AMP template or use remove the icon using
   some CSS styling. An alternative is to chose a different theme for your AMP URLs,
   such as one of the confirmed [AMP compatible themes](https://amp-wp.org/ecosystem/themes/).
 * If you need any assistance with the above let me know.
 *  Thread Starter [RAJDEEP DAS](https://wordpress.org/support/users/linuxrajdeep/)
 * (@linuxrajdeep)
 * [4 years, 10 months ago](https://wordpress.org/support/topic/adding-adsense-auto-ad-code/#post-14671520)
 * Can’t figure out the exact PHP function code which can hide this favicon from
   the AMP template.
    Using the AMP Legacy: Reader Theme option.
 * Can you share the exact code which will work?
 * Or I have found [this ](https://isabelcastillo.com/amp-remove-icon)code. Should
   I use this?
    -  This reply was modified 4 years, 10 months ago by [RAJDEEP DAS](https://wordpress.org/support/users/linuxrajdeep/).
 *  [James Osborne](https://wordpress.org/support/users/jamesosborne/)
 * (@jamesosborne)
 * [4 years, 10 months ago](https://wordpress.org/support/topic/adding-adsense-auto-ad-code/#post-14675855)
 * Thanks for the update. You could indeed use a CSS based solution, similar to 
   that which you’ve already shared. The below is an example of a working snippet–
   which must be added to your active themes functions.php or preferably a custom
   plugin or custom functions plugin.
 *     ```
       add_action( 'amp_post_template_css', function() {
               ?>
               /* Put Custom CSS below */
              .amp-wp-header .amp-wp-site-icon {
               display: none;
           }
               <?php
       } );
       ```
   

Viewing 12 replies - 1 through 12 (of 12 total)

The topic ‘Adding AdSense Auto Ad code’ is closed to new replies.

 * ![](https://ps.w.org/amp/assets/icon.svg?rev=2527602)
 * [AMP](https://wordpress.org/plugins/amp/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/amp/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/amp/)
 * [Active Topics](https://wordpress.org/support/plugin/amp/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/amp/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/amp/reviews/)

 * 12 replies
 * 3 participants
 * Last reply from: [James Osborne](https://wordpress.org/support/users/jamesosborne/)
 * Last activity: [4 years, 10 months ago](https://wordpress.org/support/topic/adding-adsense-auto-ad-code/#post-14675855)
 * Status: resolved