How to add Google Adsense code in WordPress easily?

I have recently come up seeing this questions, thought it would be helpful if I write a quick post on this topic. So this simple guide will help you to add Google Adsense code in WordPress.

I am going you to explain you with two different ways.

  • Native WordPress Custom Html Plugin
  • Custom Plugin Ad Inserter

I have been personally using ad inserter in this blog. Anyway, i will explain both the way and let you decide what’s best for you. let’s see the first option.

Native WordPress Custom Html Plugin

Get your Adsense code from  the Google Adsense which might look like this


<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<ins class="adsbygoogle"
style="display:block; text-align:center;"
data-ad-format="fluid"
data-ad-layout="in-article"
data-ad-client="ca-pub-9209595075681550"
data-ad-slot="5052197858"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script>

Steps to follow:

  1. Go to Appearence->Widgets.
    How to add Google Adsense code in WordPress easily
    How to add Google Adsense code in WordPress easily

     

  2. Drag&drop the custom HTML widget on your blog sidebar.

    How to add Google Adsense code in WordPress easily
    How to add Google Adsense code in WordPress easily
  3. Paste the code and save it.
  4. The result will look like this.

    How to add Google Adsense code in WordPress easily
    How to add Google Adsense code in WordPress easily

So this allows you to place only to the placeholder that is available within your theme for example header, footer, and sidebar.  But if you looking to show the ads in more customized manner keep reading to the second option.

Custom Plugin Ad Inserter:

Get your Adsense code from  the Google Adsense which might look like this


<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<ins class="adsbygoogle"
style="display:block; text-align:center;"
data-ad-format="fluid"
data-ad-layout="in-article"
data-ad-client="ca-pub-9209595075681550"
data-ad-slot="5052197858"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script>

Steps to follow:

  1. Go to Plugins – > Add new.
    How to add Google Adsense code in WordPress easily
    How to add Google Adsense code in WordPress easily

     

  2. Search “AD Inserter” install and activate it.
    How to add Google Adsense code in WordPress easily
    How to add Google Adsense code in WordPress easily

     

  3. Go to Settings -> Ad inserter.You will see something like this
    How to add Google Adsense code in WordPress easily
    How to add Google Adsense code in WordPress easily

     

  4. You can paste almost 16 different ad script here with a differnt combination of placeholder.
  5. Click on number 1 and paste your ad code.How to add Google Adsense code in WordPress easily
  6. Now you can choose the placement from this below options
    How to add Google Adsense code in WordPress easily
    How to add Google Adsense code in WordPress easily

     

  7. You can also filter whether it should appear in post individually or on all post. similarly for pages. And for few general pages, there are checkboxes to decide the show/hide.
    How to add Google Adsense code in WordPress easily
    How to add Google Adsense code in WordPress easily

     

  8. This top bar gives you more customization based on device and manual placements. If you want any specific customization to feel free to check here. Most of the settings are intuitive.
    How to add Google Adsense code in WordPress easily
    How to add Google Adsense code in WordPress easily

     

  9. Finally, here you have the post length condition. You can specify condition if you want, otherwise, let it be as it is. An example condition would be between 400-600 words. Then post having the word count from 400-600 only will display the ad code ads.
    How to add Google Adsense code in WordPress easily
    How to add Google Adsense code in WordPress easily

     

  10. Similar you can create up to 16 placements with different combinations.
  11. And also you have extra CSS settings, adblocker response setting here with some more settings if you want to get more advanced.
    How to add Google Adsense code in WordPress easily
    How to add Google Adsense code in WordPress easily

     

So these are the easy two options to add Google Adsense code in WordPress easily. If you want to know more about the advanced user settings of the ad inserter please let me know in comments. For more random post subscribe us.

To read more: http://wedontsellanything.com