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.
Google’s Adscense policy.
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. So I wrote my own Simple Adsense Insertion Plugin for WordPress, to focus on having 1-5 Google Adsense codes saved and use them where ever I want on my site by inserting a simple shortcode to my posts, pages and sidebar.
Simple Google Adsense Plugin Installation
- Unzip and Upload the folder ‘WP-Simple-Adsense-Insertion’ to the ‘/wp-content/plugins/’ directory.
- Activate the plugin through the ‘Plugins’ menu in WordPress.
- Go to Settings and configure the options eg. Copy and paste the Google Adsense code that you want to use.
- 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.
Compatibility
Works with the latest version of WordPress.
Requires
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 </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, check out our list of best WordPress plugins to find out what other plugins you should be using.
Thanks for the great plugin, I’ve been using this for awhile and absolutely love it!
I have used adsense for a while now, found this adsense plugin on Google tried it, it works nice, thanks for the post.
Looking for different Adsense plugin, really thanks for the sharing!
I have used adsense for a while now, found this adsense plugin on Google tried it, it works nice, thanks for the post.
Looking for different Adsense plugin, really thanks for the sharing!
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!
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!
You are grate man. Your all plugins are attractive. Please give us some more excellent plugins and tips.
i have been looking around so long for this plugin. thanks very much
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! 🙂
THANK YOU SO MUCH! Mr. Ruhul Amin
This worked like a charm and I just LOVE the easy of placing goggle ads.
Thank you so much!
This plug-in is really useful!
it is just what I needt!
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.”
@Norm, What happens when someone clicks on the Google Ad is controlled via your Google Adsense account.
Nice plugin. Thanks.
Is there a way to have Google Adsense open in a new window instead of leaving my site?
Thanks! I will try it.
Precisely what I was looking for! Thanks for the awesome plugin, have been using it for two weeks and am really satisfied!
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.
I was using the All in One AdSense and YPN plugin which seems to work well on my blogs.
Great plugin i will try in my blog soon.
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
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.
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
Nice and great plugin bro. thanks for this
nice site
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?
very good site
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. =)
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
Great plugin. Simple and effective. Thanks.
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.
Thanks for your plugin. Although you have created it to use adsense, it is also a good tool for using javascript in wordpress. Thanks.
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.
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.
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
Great plugin. Thanks.
Thank you for plugin !!!!
is very, very simple and useful.
Best regards
One thorough info I have found on this topic on the net. in order to be back soon to follow-up.
The plugin will work fine on WordPress 2.9.2
why you don’t upgrade this plugin so it’s can compatible with wordpress 2.9.2 ??
great plugin, it’s very useful
Thanks
Thanks for the plug-ins. Plug-ins make life easy and do think about content of the page rather than programming. 🙂
You guys rock!!!
This plug-in definitely has some merit for AdSense insertion. However, since you have to do PHP anyway, why not just add the AdSense code to your template pages and not have to deal with a plugin. Of course, this is my thinking but it takes a pretty good knowledge of your template.
This is great. I couldn’t figure out how to add an adsense block at the top of a main page (in an Artisteer theme) without causing the sidebar to drop down. With this plugin, all I had to do was add a blank sticky post with the code inside. Presto! A large rectangle adsense block at the top of the main page, and the sidebar still in the right position. Thanks for a tremendously useful plugin.
I’ve been rebuild my blog and this plugin is would be great to use… thanks 😀
There is the way to add more then three Ad Campaign?
Thanks
Thank you for the great plugin , i’m using it and fully satisfied
thanks for that info… it is really works and awesome
Well! If you look on the left side of the WordPress page, down at the bottom under “Settings”, ya see what I’ve been reading about here! I am SO sorry and feel a little silly, but I hope everybody else can find this more quickly than I did.
THANK YOU!
Hi! From what I’ve read here, this is a super plugin that I’ve downloaded to put Adsense Ads in my blog’s sidebar. Being able to USE programs and NOT write them, I have a few remedial questions, please: What does “call the function” mean in kindergarten terms? Where do I put the google ad code, again, in kindergarten terms, please?
I’m sorry to be such a pain. Thanks in advance for your response!
hii..thank you very,,very much, its useful for newbie like me