WordPress Plugin for Simple Google Adsense Insertion/Integration

Easy to use WordPress plugin to insert Google Adsense to your posts, pages and sidebar by using a trigger text or calling the php function.


There are many plugins and services which can add Google Adsense to your WordPress site. However I found that even though something like Adsense Manager or Adsense Deluxe provides a lot of customizable options, it can be overwhelming and isn’t really simple enough for people who are new to WordPress or for people who simply want to insert Google Adsense to their site in a few clicks.

I found that most of the time I only use two or three types of Google Adsense units in various places and posts throughout my sites. Google’s Adscense policy mentions to not have more than three adsense block in one page anyway. That’s why I wrote my own Simple Adsense Insertion Plugin for WordPress, to focus on having 1-3 Google Adsense codes saved and use them where ever I want on my site by inserting a simple trigger text to my posts,pages and sidebar.

App Category
WordPress Plugin
Software Name
Simple Google Adsense Integration
Date Modified
Operating System
WordPress 4.8
WordPress 3.0 or higher
USD $0
A simple plugin to add Google adsense to your WordPress site
Landing Page
File Format

Simple Google Adsense Plugin Installation

  1. Unzip and Upload the folder ‘WP-Simple-Adsense-Insertion’ to the ‘/wp-content/plugins/’ directory.
  2. Activate the plugin through the ‘Plugins’ menu in WordPress.
  3. Go to Settings and configure the options eg. Copy and paste the Google Adsense code that you want to use.
  4. Add the trigger text [wp_ad_camp_1] to a post or page where u want it to appear.

Simple Google Adsense Plugin Usage

There are two ways you can use this plugin:

1. Add one of the following shortcodes (trigger text) on a post or page

  • [wp_ad_camp_1]
  • [wp_ad_camp_2]
  • [wp_ad_camp_3]
  • [wp_ad_camp_4]
  • [wp_ad_camp_5]

2. Call one of the functions from your theme’s template file:

  • <?php echo show_ad_camp_1(); ?>
  • <?php echo show_ad_camp_2(); ?>
  • <?php echo show_ad_camp_3(); ?>
  • <?php echo show_ad_camp_4(); ?>
  • <?php echo show_ad_camp_4(); ?>

Using In-Article Ads

This plugin allows you to automatically insert adsense ad code after the 2nd paragraph of every posts. If you want to use this feature then copy and paste the ad code in the In-article Ad Code field of the settings menu of this plugin.

Adding Adsense At the End of Every Article

This plugin allows you to automatically insert ad code at the end of every article. Go to the settings menu of this plugin then enter your ad code in the Post-article Ad Code field to activate this feature.

Plugin Download

Download the Google Adsense Plugin.


Works with the latest version of WordPress.


Requires WordPress 4.0 or higher.

Donation Option

Donation option can be found on our projects page.

Change Log

  • Version 1.1 – Fixed an issue whereby sometimes Google Adsense code were disappearing from the settings page in some WordPress themes.
  • Version 1.2 – Devlin from wptheming.com added proper shortcode implementation for placing the ads (this way you don’t have to use the old filtering options anymore)
  • Version 1.3 – Added shortcode filtering on sidebar
  • Version 1.4 – Added shortcode filtering on widget text and excerpt
  • Version 1.5 – Added a 5th ad slot
  • Version 1.6 – WordPress 3.8 compatibility update
  • Version 1.7 – WP 4.2 compatibility

Additional Documentation

How to Add Google Adsense to the Sidebar

You can use the shortcodes (example: [wp_ad_camp_1]) in the sidebar to show Google Adsense ad in the sidebar widget. Simply ad a text widget to your sidebar and place the shortcode in there.

Alternatively, you can add Google Adsense on the sidebar using the ‘Simple Adsense Integration’ Plugin by using the following PHP function:

<?php echo show_ad_camp_1(); ?>

If you are calling the function from the theme’s template file (sidebar.php) then you are fine but there is another way to do this using the widgets which could be more practical in some cases.

1. Download and activate a PHP code executable plugin if you don’t have it already. This type of plugins allow you to call PHP functions from the widgets (it is similar to the Text widget but it lets you execute PHP code too).

2. Go to the widgets menu and add a ‘PHP Code’ widget to the sidebar (where you want to display the Google Adsense block). Now add the following line of code and save the settings:

<?php echo show_ad_camp_1(); ?>

This will display an The Google Adesne ad that is saved in the number one textarea of this plugin.

How to Wrap Text Around a Google Adsense Block

To left align the Adsense block and wrap text around it just use the following div for the Adsense unit in HTML view:

<div style="float: left;">
Adsense Goes Here

To right align the Adsense block and wrap text just change “float: left;” to “float: right;”. So for an example, the following will left align the Adsense Unit that is saved in the Ad Campaign 1 box and wrap text around it.

<div style="float: left;">

If you need help with this plugin or want to suggest an enhancement/feature then please let me know by leaving a comment in the comment area below.

Also, check out our list of best WordPress plugins to find out what other plugins you should be using.

Comments (233 responses)

  1. admin says:

    @Darren, Yes. You will need to modify your theme’s template file to that though.

  2. Darren says:

    Can we add AdSense ads in a category loop page or a search result page, and specify specific spots, say for example, after or before the 1st and 3rd post on the list, something like that? Thank you. By the way, is it allowed by Google to place ads on those pages?

  3. admin says:

    @Emily, You just have to use the shortcode in a post (the function call is if you wanted to use it in your theme’s template file).

  4. emily g says:

    Do I just have to put the short code into the post? Or do I have to do this too: ” Call one of the functions from your theme’s template file:” If both, how do I do the 2nd?


  5. admin says:

    @Chris, This plugin works with any theme (so the theme shouldn’t be any issue). If you have added the adsense code using this plugin then you don’t have to worry about anything else. Just give it some time so the ads can show up. It does take a bit of time for a newly created adsense add to start serving. So check it tomorrow to see how your ad looks on the site.

  6. Chris says:

    I passed the initial adsense stage and now they have asked me to put the code on my website.

    I used your plugin to do that but my account is still asking me to place the code somewhere. I’m using Divi theme, if that makes a difference?

    Is this a common plugin / theme problem or is Google just taking their time to crawl the test ads?

    Thank you very much for any reply 🙂

  7. admin says:

    Is your theme showing only excerpt for the category archive pages? I don’t think the shortcode is being rendered on that excerpt.

  8. Subramanian says:

    Thanks for awesome plugin.

    This plugin does not working on category archive pages. Its showing only shorcodes.

    Any solution?


  9. admin says:

    @Elton, Yeah you can use those shortcodes one after another.

  10. Elton says:

    Congrats for the plugin! It’s really easy to introduce the ads on pages.

    One question, in case I want to place two ads side by side in the midle of a post or page, if I introduce the codes [wp_ad_camp_1] and [wp_ad_camp_2] one after the other I reach this feature?

  11. Josh says:

    I would like to see the option to add more sections as needed. Maybe a name function out to the side of each one so we can label them within the settings page. I think more slots for ads would be great because adsense lets you create a large variety of ads and gives you many different options for various pages/posting styles. Giving the user options like this would be great!

  12. Craig says:

    I use this plugin on one of my two sites, it really works great and I REALLY wish I had used it on the other as I’m now faced with changing a bunch of pages…

    I’ll add my vote for having additional ad slots for a couple of reasons: Users might use different size and or colors of ads on pages than they do on posts. Having a variety of options is always good. Rather than using the additional slots to make a spamy page sometimes a different size ad will just fit better.

    And I “assume” this plugin could really be used as an insert anything tool (haven’t tired it as I don’t have enough slots~~), which would really be handy for use with stuff you want to change site wide periodically…

    Just my 2¢

  13. Kamal says:

    Hi there Bro, I tried this today and it works perfectly. Unlike other plugins out there that try to embed “sneakingly” authors adsense code for revenue share, this plugin has no sneaky tricks. I just LOVE the simplicity and honesty of the Author of this plugins. I would happily pay something for this plugin. Thank you very much.

  14. Eric says:

    Great plugin. Love the simplicity. It’s also the only one that I could get to work on our theme (well I stopped looking after I found yurs) :).

    Does it only do adsense or could I create an affiliate ad that I could then add to certain posts using the shortcode? I guess I could test it to find out, but even if it did work I just want to make sure there’s nothing on the backend that might be causing some unseen issue.

    Also, I copied the instruction for “how-to wrap” directly from your post. I couldn’t get it to work at first until I noticed/switched the smart quotes to the inch mark. Thought I would mention it in case anyone else has had the same issue.

  15. admin says:

    @Albert, At the moment there is a limit of 4 adsense ad. When I first created this plugin I didn’t think you would need more than that many ads (because if you use too many ads it starts to get spammy). I find that 2 or 3 nicely positioned ad can do really good (rather than slapping too many). If a few users want more than 4 ads, I will add the option for that.

  16. Albert says:

    It works fine for me. But is it possible to place more than 4 adds (different codes) on a page. Now i see [wp_ad_camp_1-4]. Is that the limit?

    Thanks in advance

  17. admin says:

    @Catherine, You don’t have to add anything in the stylesheet. You can open your theme’s “single.php” template file. Then use the code just below the title and that will show the adsense ad below the post title. Or you can use the shortcode inside your post (when you are editing a post you can insert the adsense shortcode).

  18. catherine says:

    Hi there. We would like to have a leaderboard Adsense banner across the top of our landing page (under the header).

    Our website developer charges us huge fees to keep going back to have them ad things, tweak things, etc. We are trying to do this ourselves to avoid them but we are scared we’ll mess something up.

    Would I insert this plugin in the stylesheet? We know how to insert things in the sidebar but don’t want another ad there. Our issue is inserting things in the upper part of the page. Can you advise?

  19. June says:

    Love this plug in for google adsense. So easy to use.

  20. Prince says:

    The simplicity and straight action of this adsense plugins cannot be over-emphasize. This is really great . Thank You.

  21. eimgur says:

    excellent plugin

  22. admin says:

    @Jo, at the moment we have set a limit of 4 ads because we find that using more than 3 to 4 ads on a page makes it look very spammy. However, we have received a few requests to increase the number of Adsense ads you can have with this plugin. We intend to add a few more slots in a future version.

  23. Jo says:

    Hi 🙂 Your plugin has made life incredibly easy for me 🙂 I just wondered, is it possible to use more than four ads or is that the maximum? Thanks x

  24. Ivy says:

    @Sabrina, Yes this should work with 3.5.1.

  25. sabrina says:

    will it work with 3.5.1 wp ? any body?

  26. Abdul Rahman says:

    Its one of the most useful WordPress Plugins for Adsense Ads management. I have no knowledge of PHP coding but still this plugin helps with the insertion of ads easily. Thanks for creating this useful plugin and offering it free of cost

  27. Ishak says:

    Thanks for sharing the plugin. will try it in my blog.

  28. Amy says:

    Cool. I didn’t know I can actually do that one to make things simpler. I will try to insert Google adsense your way to my wordpress blog.

  29. Arpan Das says:

    This plugin is very useful… I tried 3-4 adsense plugins, but this one works great…

  30. Irol Trasmonte says:

    I’ve been looking for the perfect Adsense Plugin for my new website and I found the answer in this Plugin. I will surely recommend this to others. The best and simplest one by far, a Million Thanks, really.

  31. jonny supat says:

    This plug-in is really useful!
    easy to use it. thanks

  32. Preston says:

    Awesome plugin… About the only decent one that allows you to insert Adsense into PAGES and not only posts. Worth donating to this one!

  33. zigga says:

    Excellent plugin.Thanks for sharing.

Speak Your Mind