WordPress Plugin for Simple Google Adsense Insertion/Integration

Categories: Wordpress Plugin

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.

download_icon

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 Adsense 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.

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.

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]

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(); ?>

This Plugin in Action

See this plugin in action on Antique HQ.

Download

Download the Plugin from here.

Donation Option

Donation option can be found on my 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

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 the Executable PHP code plugin if you don’t have it already. This plugin lets you call php functions from the widgets (it’s 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
</div>

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;”>
[wp_ad_camp_1]
</div>

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, checkout the list of best WordPress plugins to find out what other plugins you should be using.

Articles you may also like:

  1. Easy to use WordPress plugin for Contact Form
  2. WordPress Easy Paypal Payment or Donation Accept Plugin
  3. Improve your daily productivity, 7 must use Google products!
  4. Manage your wordpress web ads easily
  5. Query or show a specific post in wordpress
Tags: , , ,

Subscribe to Tips and Tricks HQ to stay informed

twitter_icon

190 Responses.

  • #1 by Carol on January 12, 2012 - 7:06 pm

    Just started using this plugin on my own wordpress blog, you can have a max of 3 ads per page, and its boosted my adsense clicks.

  • #2 by K on January 2, 2012 - 9:51 pm

    Brilliant plugin .. I have never seen an adsense plugin which is SOOOO easy to use ! Well done … very well done

  • #3 by Tom on December 14, 2011 - 11:38 am

    I spent all day working on Adsense ads, channels and putting ads on my posts. And
    I just uploaded the Simple Adsense plug-in. It looks nice and easy to use.

    Thanks!

  • #4 by google trends on December 5, 2011 - 3:07 pm

    This adsense plugin is something I will be using in the future. :D This will really help me allot. :)

  • #5 by Milla on November 11, 2011 - 2:57 am

    Excellent plugin. Sure made my life a lot easier.

  • #6 by Innan on November 9, 2011 - 12:18 am

    like simple and easy,I will try this plugin, thanks for sharing this great information.

  • #7 by Tharu on October 28, 2011 - 1:32 am

    I,m new to Google adsense. But this is simple and great. Thank you

  • #8 by Charmy on October 2, 2011 - 4:20 am

    Thanks for the great plugin, I’ve been using this for awhile and absolutely love it!

  • #9 by oil tanks on September 2, 2011 - 5:26 pm

    I have used adsense for a while now, found this adsense plugin on Google tried it, it works nice, thanks for the post.

  • #10 by goarticles on August 30, 2011 - 8:18 am

    Looking for different Adsense plugin, really thanks for the sharing!

  • #11 by folding beds on August 5, 2011 - 9:31 pm

    I have used adsense for a while now, found this adsense plugin on Google tried it, it works nice, thanks for the post.

  • #12 by Halogen Oven on July 26, 2011 - 11:49 am

    Looking for different Adsense plugin, really thanks for the sharing!

  • #13 by Kelly| product reviews on June 11, 2011 - 3:16 am

    I spent all day working on Adsense ads, channels and putting ads on my posts. And
    I just uploaded the Simple Adsense plug-in. It looks nice and easy to use.

    Thanks!

  • #14 by Gifts For Moms on June 7, 2011 - 12:36 am

    Pretty nice post. I just stumbled upon your blog and wished to say that I have truly enjoyed browsing your blog posts. After all I will be subscribing to your rss feed and I hope you write again very soon!

  • #15 by Oronno on June 4, 2011 - 10:56 pm

    You are grate man. Your all plugins are attractive. Please give us some more excellent plugins and tips.

  • #16 by nicolas simpson on May 17, 2011 - 8:31 pm

    i have been looking around so long for this plugin. thanks very much

  • #17 by Derek on April 29, 2011 - 2:55 pm

    Great plugin. I also tried to use a banner ad with html, but that did not word. Will just have to hard code it!
    Simple GAI makes life a bit easier, so thanks! :)

  • #18 by StandSuccess on April 6, 2011 - 3:52 pm

    THANK YOU SO MUCH! Mr. Ruhul Amin
    This worked like a charm and I just LOVE the easy of placing goggle ads.

  • #19 by ShenYu on February 4, 2011 - 10:04 pm

    Thank you so much!
    This plug-in is really useful!
    it is just what I needt!

  • #20 by Norm on January 28, 2011 - 1:14 am

    Thanks for the quick response. This is what I found on AdSense help

    “Generally, it is our policy to not allow Google ads to open in a new window…We also ask that you don’t modify the AdSense ad code or alter the result of clicking on an ad on your website, as such behavior violates our program policies.”

  • #21 by admin on January 28, 2011 - 12:26 am

    @Norm, What happens when someone clicks on the Google Ad is controlled via your Google Adsense account.

  • #22 by Norm on January 27, 2011 - 10:32 pm

    Nice plugin. Thanks.

    Is there a way to have Google Adsense open in a new window instead of leaving my site?

  • #23 by Diana on January 23, 2011 - 8:29 pm

    Thanks!
    I will try it.
    .-= Diana´s last blog ..Back to basics =-.

  • #24 by alex work on January 12, 2011 - 5:02 am

    Precisely what I was looking for! Thanks for the awesome plugin, have been using it for two weeks and am really satisfied!

  • #25 by Kimi on December 16, 2010 - 3:09 am

    Thanks for this plugin.

    I remember one of readers asked me about the best adsense wordpress plugin, and i could not give answer.

    This is because i haven’t used any plugins so far for adsense in my blog, but i will try this one, and give a review soon for my readers.

    Thanks.
    .-= Kimi´s last blog ..w3 total cache vs wp super cache Video review =-.

  • #26 by Justin Germino on December 14, 2010 - 9:09 pm

    I was using the All in One AdSense and YPN plugin which seems to work well on my blogs.
    .-= Justin Germino´s last blog ..AdSense Adjustments Reap Earnings Increase =-.

  • #27 by aa Inn on December 4, 2010 - 12:29 am

    Great plugin i will try in my blog soon.
    .-= aa Inn´s last blog ..How to Build Big Triceps =-.

  • #28 by Dennis "DennisKnows" Marshall on November 21, 2010 - 10:55 pm

    I definitely needed this. I spend almost an hour today trying to wrap the text around my ad and what made it hard was all that adsense coding. It messes with the eyes.

    thanx
    .-= Dennis “DennisKnows” Marshall´s last blog ..Who’s in your CIRCLE of SUCCESS =-.

  • #29 by Jon on November 2, 2010 - 5:17 pm

    I like Quick Adsense most. Easy to place adverts advert paragraphs as well as before and after content. Sorts out alignment too. Widgets are not so good, but I do not use those.
    .-= Jon´s last blog ..Google’s Wonder Wheel Search Tool =-.

  • #30 by Barry Halogen Oven on October 31, 2010 - 7:59 pm

    I’ve been thinking about using Adsense on my site for a while now but I just couldn’t figure out the best way to go about it.

    Thanks to the info in this post I’m going to get to work right away & get set up with Adsense.

    Thanks

    Barry

  • #31 by jeiboy on October 6, 2010 - 1:06 pm

    Nice and great plugin bro. thanks for this
    .-= jeiboy´s last blog ..Winning Eleven 7 Game Cheat Code List Part 2 =-.

  • #32 by bushra on September 14, 2010 - 12:59 pm

    nice site

  • #33 by ali on September 9, 2010 - 8:58 am

    Yes, exceptionally good plugin. I have recommended it often. A great little tutorial as well. Do you have a plans to offer up a video tutorial as well?

  • #34 by shahbaz on August 29, 2010 - 12:01 am

    very good site

  • #35 by Ivy on August 25, 2010 - 11:37 pm

    Hi James, Yes we are working on getting video tutorials up on the site for our tutorials. But as we all know videos can take forever but they are on the way. =)

  • #36 by James Martell@ Affiliate Marketing Training on August 25, 2010 - 7:14 pm

    Yes, exceptionally good plugin. I have recommended it often. A great little tutorial as well. Do you have a plans to offer up a video tutorial as well?

    James
    .-= James Martell@ Affiliate Marketing Training´s last blog ..Is Google AdSense A Poor Second Cousin To Affiliate Programs =-.

  • #37 by Norm on August 6, 2010 - 12:39 pm

    Great plugin. Simple and effective. Thanks.
    .-= Norm ´s last blog ..Grizzly Cub on Highway Shoulder =-.

  • #38 by mapo on July 17, 2010 - 8:13 am

    There are many ways to use Ad Sense to achieve your goals.Some people are using Ad Sense to earn a great deal of money in amounts that you would not have thought was possible unless you robbed a bank.

  • #39 by cocker on July 14, 2010 - 8:59 pm

    Thanks for your plugin. Although you have created it to use adsense, it is also a good tool for using javascript in wordpress. Thanks.

  • #40 by Amanda on July 10, 2010 - 2:14 am

    Hi admin,

    Thank you so very much for this plugin.

    I tried the most highly recommended plugin for Adsense (I won’t name it) and although it inserted the Googe Adsense ad in my sidebar, it also inserted certain other non-Google advertising badges at the beginning of my posts! Grrr!

    I deactivated it and found this one. It was a snack to use and your How-To instructions on this post are really clear and easy to follow.

    Thanks again for making this process painless.
    .-= Amanda´s last blog ..Get Published Without An Agent Read Emma Michaels’ Amazing Story =-.

  • #41 by Umesh on June 14, 2010 - 7:37 am

    This is great help for beginners. I still remember I spent whole day to figure it out where to put google adsense to display on my blog.
    .-= Umesh´s last blog ..Choosing an Exposure Mode : Aperture Priority and Shutter Priority =-.

  • #42 by Kay on June 2, 2010 - 4:57 pm

    Hi I like the clean theme of your site, the design and the ad location. I am a newbie- any tips you could give me would be much appreciated. Thanks.

    kayblogger
    .-= Kay´s last blog ..Free Themes and Templates =-.

  • #43 by Umesh on May 29, 2010 - 2:57 pm

    Great plugin. Thanks.
    .-= Umesh´s last blog ..What is bokeh effect in photography? =-.

Featured & Popular Articles

Tips and Tricks Hot Items

wordpress estore plugin
wordpress membership plugin
WordPress PDF Stamper Plugin
WordPress Lightbox Ultimate Plugin
WordPress Affiliate Link Manager Plugin
wordpress affiliate plugin