• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer

Tips and Tricks HQ

  • Home
  • Projects
    • All Projects
    • Simple WP Shopping Cart
    • WP Express Checkout Plugin
    • Accept Stripe Payments
    • WP Download Monitor
    • Easy HTTPS Redirection
    • WP Security and Firewall Plugin
    • WP eStore Plugin
    • WP Affiliate Platform
    • WP eMember
  • Products
    • All Products
    • Checkout
  • Support
    • Support Portal
    • Customer Only Forum
    • WP eStore Documentation
    • WP Affiliate Software Documentation
    • WP eMember Documentation
  • Contact

WordPress Plugin for Simple Google Adsense Insertion/Integration

Home » Blog » WordPress Plugin for Simple Google Adsense Insertion/Integration

Last updated: July 14, 2018

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.

Summary
App Category
WordPress Plugin
Software Name
Simple Google Adsense Integration
Version
1.9
Date Modified
2018-14-17
Operating System
WordPress 4.9
Requirements
WordPress 3.0 or higher
Price
USD $0
Description
A simple plugin to add Google adsense to your WordPress site
Landing Page
https://www.tipsandtricks-hq.com/wordpress-plugin-for-simple-google-adsense-insertion-170
File Format
application/zip
Download

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.

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.

Related Posts

  • Easy to use WordPress plugin for Contact Form
  • WordPress Easy Paypal Payment or Donation Accept Plugin
  • Improve Your Daily Productivity, 7 Must use Google Products!

Wordpress Plugin Google,  google adsense,  Wordpress,  Wordpress Plugin

Reader Interactions

Comments (195 responses)

  1. Andrew Molobetsi says:

    I also tried this plugin or something similar a few months back but got stuck before I could finish setting it up. Too technical, perhaps. Maybe if I give it another go it will work. Wish me luck!

  2. gozn says:

    very think you !!!

  3. ONLY IN THE PHILIPPINES says:

    Great article. I will try to use this plugin in my blog. More power!

  4. afvia says:

    Good Plugins … , I New Blogger, and this tips, it’s important for me. Thank’s

  5. admin says:

    @Cyberquill, thanks for the correction… I have updated the plugin.

  6. Cyberquill says:

    Ooops–I meant it said adsene three times.

  7. Cyberquill says:

    Just downloaded the plugin. Haven’t tried it yet. I’m sure it’s great.

    One typo: On the WP Settings page it says adsense three times:

    Options
    Adsense Ad Campaign 1 Code:
    Copy and Paste the Google adsene code here. To show this add in your posts or pages use the token

    (2 more times below that)

  8. admin says:

    Looks like you did everything right… please note that there is a bit of delay before the ads start to appear for a newly created Adsense unit (I have seen upto 30 mins of delay sometimes)

  9. Paul says:

    I am looking for plugin that I can insert the Google adsense on sidebar. I found your plugin and thought it would be the solution. However, after installation two plugin, “Simple Google Adsense” and “PHP code”, the ad did not show up on my sidebar. I wonder if what I did was wrong. I entered the Google adsense here, Adsense Ad Campaign 1 Code. Then I entered the code to call and execute the campaign 1 code in PHP widget under the widget template.
    Am I missing some steps here? Please help.

    Thanks

  10. American Doll Clothes says:

    I copy and pasted the code into my website and tried to align left and it did not work. I believe that the code is broken.

  11. Dave says:

    Love the plugin…ran into a problem though. The adsense code works absolutely great for content insertion into my WP posts, but only the top 3. Anything after that is blank.
    I used the same campaign for the posts inside the code. I havent had much of a chance to research it, but have you heard any issues with templates and the plugin?
    I am going to look into google next to make sure it isnt flagging me for flooding as i insert one block on each blog post, but if there is an issue please let me know 😉
    Really great work on the plugin never had one bit of trouble getting it setup and implemented!

  12. Yjc says:

    Awesome plugin! Super thanks!

  13. Lydia says:

    This seems like the perfect plugin for me. Not got the sidebar working yet but having read the above I’m sure I will soon. Yes that is all I want – the possibility of 3 sets of ads.

    Many thanks.

    Lydia

  14. Bart Heemskerk says:

    Thank you for making this great plugin!

  15. ben gumbelt says:

    nice info, i like this plugin, very useful, thanks for your sharing

  16. admin says:

    @Charlie, edit your “single.php” file and call the function. This will put the ad code on every post.

  17. Charlie says:

    Hi, I was wondering how can insert the code automatically into every post?

    Which template file would I need to edit? Thanks

  18. atinder says:

    Really nice plugin for noobs ……….

  19. Michele says:

    Great plugin!

    I usually try random php function to test more effective adsense and so more than 3 camps will be usefull.

    Thank you

  20. admin says:

    @Sidh, Google won’t serve you Adsense ads when your site is on your local computer

  21. Sidh says:

    Hi, Thanks for the plug-in. I have one question regarding plugin. I did everthing as per the procedure given by you. But how will I see the Google ad practically ? I didn’t receive any error message. But I couldn’t see Google ad ! I am trying this with at my localhost. Is there any way I can see the Ad in the localhost ?

  22. Accounting Teacher says:

    Hi
    This is for blog, Is there any thing which does the same thing with ordinary pages created with frontpage?

  23. Michael says:

    Very good work, and thank you. Exactly what I need.

  24. admin says:

    Hi Zoey,are you using the PHP code widget or the normal Text widget? Please note that the normal wordpress text widget doesn’t execute PHP code so you will have to use the PHP code widget.

  25. Zoey says:

    I’m trying to use your plugin via the php widget method so it will show up in my sidebar. I am using WordPress 2.8.4 and theme is Arthemia. Don’t run into any problems when I’m setting it all up but it just appears as blank on the website.

    Can you help??

  26. Lara Maloney says:

    OMG please just ignore me – just read further down the comments above and saw that someone had the same problem…followed their lead. It works fine now. Thanks!
    xx

  27. Lara Maloney says:

    Hello

    I am using your fabulous plugin – so far so good. Just trying to get my adverts to get the text wrapping code (as explained above) working, to no avail.

    My HTML code within my blog looks like this :

    …..best life of our dreams…the Ultimate Lifestyle.

    As the ancient Chinese proverb states…..

    but it is just not wrapping. Can you please help me??
    thanks so much.

  28. E says:

    Newbie here. Will this plug in work for WP version 2.8.4?

  29. Mitchell Krog says:

    FINALLY, a simple no nonsense adsense unit that actually works. Good job, thanks very much for this.

  30. Rod Neville says:

    Hi there, Thank you for the response. My test site is
    http://perfectlamp.net/wp-admin/index.php

    Thanks again.

    Rod

  31. admin says:

    Hi Rod, I am not familiar with the FCKEditor so can’t really tell you what is going on. If you can give me access to your test site if you have any then I could have a look and see what is wrong.

  32. Rod Neville says:

    Greetings,
    I’m a newbie with a funny question. You mentioned that I need to insert a trigger on a page in html view. However I do not see the switch button on my WordPress control panel. BTW, I use a plugin called FCKEditor. I noticed that there’s a button that that menu called Source which toggles between regular text and seeing some kind of code with tags. I pasted the trigger to the end of the code but still no luck. Can you help me please? Thank you.
    Rod

  33. admin says:

    Hi Frank, The settings menu for this plugin is located under “Settings->Simple Adsense Insertion” on the left hand sidebar in the admin menu.

  34. Frank says:

    Hi, I installed and activated ‘Simple AdSense Insert’ on my WP website (ver 2.8.1) with the theme ‘iNove 1.4.5 by mg12’. According to step 3 in your installation guide, I should be able to config 3 adsense codes, but I just don’t see this option in ‘Settings’. Any suggestion? Thanks.

  35. Calvin says:

    hi, i like using this thing, it’s so simple and easy to use.

    Could i make a suggestion of having to put a drop down button in the WP edit post page to select which of the three ads you want to put (with a title or desc). beats referring to the plugin page for copy-pasting.

  36. admin says:

    @NoirMom, Please download the latest version 1.1 from this page.

  37. NoirMom1 says:

    I am having the same exact problem as Capt. Ed & Donna the code is not saving when I hit the update button.

    After I hit update and then move to my post to insert the trigger word the google ad code is not saved.

    Please help

  38. S. says:

    Hi,

    That was exactly it! It was cutting/pasting the quotes from your post and onto the editor. Funny how something so silly could be the cause of the problem. Many thanks for catching that! It works like a charm now.

  39. admin says:

    Hi S, I just tested it in WP 2.8 and it works fine. I have a feeling you are directly copying and pasting the example code. Please note that when I publish the post, wordpress changes the double quotes (“) character to a slightly different type of double quotes. To get around it, please delete the double quote from the code after you paste it and reapply it manually using your keyboard and don’t forget to paste the code in the HTML view of the post.

  40. S. says:

    just to clarify “div” tags. I put the actual tag in the above post and I guess it was read as HTML.

  41. S. says:

    It still doesn’t show in the preview. For your reference, I’m using the latest WP build.

    I believe I read somewhere that WP’s HTML editor didn’t like tags.

  42. admin says:

    Can you please check the post preview After you add the style info in the HTML view of the post and before you save the post and let me know if you see the ad unit text wrapped in the preview?

  43. CoolAndy121 says:

    Hi there I like your post

  44. S. says:

    Hi,

    First of all, many thanks for this plugin! It’s an awesome tool! I tried to wraparound text just as you explained, but everytime I save the page, it wipes out the style parameters I set for the tag. Am I missing something?

  45. jackson woo says:

    You post is very helpful to me and I

  46. Artisan says:

    I had another plug in that was interfering plus, with AdSense you’re only allowed 3 ad blocks per page which I forgot about. Sorry about that…

  47. admin says:

    I only see one ad on your blog posts.. are you placing more than 4 ad blocks?

  48. Artisan says:

    Hey there,

    I’ve upgraded to 1.1 and made sure all of my ads were placed with the correct tags, but I only get about 4 ads on my blog under each entry and the rest don’t show up. Any ideas?

  49. admin says:

    @Valerie, I have added a section “How to Add Google Adsense to the Sidebar” under the “Additional Documentation” in this post which should help you insert Adsense to your theme’s sidebar.

  50. Valerie says:

    Hi,

    I’d like to know how to get the Adsense Ads on my sidebars only. I don’t want them in my posts, but would like to see them on the sidebars of my posts (and home page).

    Sorry, very new to all of this!

« Older Comments
Newer Comments »

Leave a Reply

Your email address will not be published. Required fields are marked *

Primary Sidebar

Featured & Popular Articles

Video Answers to Top WordPress QuestionsWordPress Optimization Tips and Tricks for Better Performance and SpeedEssential WordPress Security Tips - Is Your Blog Protected?WordPress Simple PayPal Shopping Cart PluginTop 15 Search Engine Optimization (SEO) Techniques I Forget to DoList of the Best and Must Use WordPress PluginsHow do I Start a Blog and Make Money Online?Good Domain Name Picking Tips for Your Blog SetupFind Out Which WordPress Web Hosting Company Offers the Cheapest and Reliable Web Hosting Solution

Featured WordPress Plugins

WP Express Checkout Plugin
wordpress estore plugin
wordpress membership plugin
wordpress affiliate plugin

Recent Posts

  • How to Use Browser Developer Tools to Inspect Elements and [...]
  • Accept Donations via PayPal from Your WordPress Site Easil [...]
  • Buy Now Button Graphics for eCommerce Websites [...]
  • Subscription Button Graphics for eCommerce Websites [...]
  • Adding PayPal Payment Buttons to Your WordPress Sidebar Ea [...]

Comment & Socialize

  • @Rob, We have just released ...
    - admin
  • I installed the plugin a co ...
    - Rob
  • @Sebastian, We've released ...
    - admin
  • I've used this plugin on a ...
    - Sebastian Djupsjöbacka
  • @John, this plugin doesn't ...
    - admin

Check out our solutions

View our WordPress plugin collection and start using them on your site.

Our WordPress Solutions

Footer

Company

  • About
  • Privacy Policy
  • Terms and Conditions
  • Affiliate Login

Top WordPress Plugins

  • Simple Shopping Cart
  • PayPal Donations
  • WP Express Checkout
  • WP eStore
  • WP eMember

Blogging Tips

  • How to Start a Blog
  • Selecting a Good Domain
  • Cheap WP Hosting
  • WP Video Tutorials
  • Simple SEO Tips

Search


Keep In Touch

Copyright © 2025 | Tips and Tricks HQ