Simple adsense

This plugin is far from fancy. It gives you six textboxes where you can write anyting, like ad-codes. Then you can display the contents of such box with a widget, a function call or just type [adsense_id="1"] in the page/post editor.


  1. Download the plugin at
  2. Upload the plugin source to the `/wp-content/plugins/` directory
  3. Activate the plugin through the ‘Plugins’ menu in WordPress


Write some ad soure codes in the admin menu. You find it under general settings. Now have you ”created an add”. There is three ways to display the add:

  1. Write [adsense_id="1"] in the page/post editor. (The very same editor you write your posts or pages in, write the code ie between two of your paragraphs)
  2. Use the widget. Just drag the widget to a sidebar. Write a title (if you want) and choose a adsense id from the selection box (since 1.0.3)
  3. For theme developers: Call the getSimpleAdsense-function with the adsenseid as parameter. Ie. echo getSimpleAdsense(1);


This plugin requires PHP5 or later.


I am calling the getSimpleAdsense-function but I don’t see any ads.
First of make sure you call the function with an parameter id that exists. If you are sure that you have text in the box with id=1. Then the function call should look like this:
<?php echo getSimpleAdsense(1); ?>




1.0.3 (2010-08-08):
Added a selection box instead of text box in the widget form.

1.0.2 (2010-08-08):
Fixed typo in the function call.

1.0.1 (2010-08-01):
I created it.

  • Pingback: Recently updated wordpress plugins: 2010.8.5 (1) | WP Note

  • Pingback: Massor av nya wordpress plugin | Tobias Nyholm

  • Stephen

    Can’t get it to work under WP 3.0.1 I get a fatal error:

    Parse error: syntax error, unexpected T_ARRAY, expecting ‘)’ in /wp-content/plugins/simple-adsense/admin.php on line 88

  • Tobias

    Hi Stephen. I think it’s because you run an outdated version of PHP. I believe it will be fixed if you remove the word ”array” in admin.php line 88.

  • Stephen

    Thx a lot. PHP files have been conneted to PHP4 by my provider. If have to change that and connect filetype PHP to PHP5.

  • Monique

    Hi. I love the simplicity of this plugin. Nice.

    Here’s what I’m trying to do with it. I’m hoping you can help. I share revenue with a friend of mine. I’d like to show his ads 50% of the time and mine the other 50%. Is there an easy way for me to do this? I can’t seem to find a good solution.

    Thanks in advance for any help you can give me.

  • Tobias

    Hi Monique.
    To keep the simplicity I have chosen not to add more functionality to the Simple Adsense plugin.
    I have started to work on another plugin thou. The new plugin will have more view options and stuff like that. I will probably deploy it in a couple of weeks.

  • Monique

    Thanks! I’ll be on the lookout for it.

  • Borg

    I write just to thanks the plugin’s author and to confirm that php5 is required ;)
    nice job!

  • Jesse

    thanks so much for this, was using another similar plugin but just realize it hadnt been working on posts with Thesis theme, this one is working great however.

  • Chilis Menu

    Using the plugin and it works great – thanks so much

  • Kharkov Guide

    Just wanted to say thanks for this easy to use plugin, I wasn’t looking for any thing fancy, I like the ability to add the single line anywhere on the page. Took seconds to get my ads on the post. Very easy to set up and exactly what I was looking for. Multiple channels is also useful for monitoring so very handy.


  • Fredrik

    Jag har laddat ner detta plugin, ska bli intressant att testa. Tack Tobias!

  • Steve

    Hi Tobias, i use your great PlugIn, but i have a question: I need to insert more than 6 Ad-Codes, because i need one code for each category. I have added up to 60 boxes in the plug-in-admin, but wenn i fill a code in box 30, i geht only displayed ”[adsense_id="30"]” in the post. Can you help me and tell me what i have forgotten to do?

  • Tobias

    Hi Steve.
    Take a look at line 43 in simple-adsense.php. There is a big (and maybe scary) regex. In the middle of that regex you find ‘[1-9]+’ change that to ‘[0-9]+’. Then it will work for you.

  • Steve

    Hi Tobis, you are GREAT! Thank you very much, for your fast help! Best regards from Vienna, Steve

  • Pingback: 57 Popular WordPress Plugins With 5 Stars Rating « Home Page

  • Pingback: Simple Adsense review, discussions, does it work, and ratings on |

  • aufa

    is this plugin work on WP 3.3?

  • Tobias

    yes it does

  • masita_lutfi

    is this plugin compatible with adsense TOS?

  • Tobias Nyholm

    I’m not familiar with adsense TOS, but yes. You just use the adsense code from google and paste it in a pox.
    Easy as pie.

  • Masita

    OK thanks Tobias, I’ll Try this plugin :)

  • Mbj

    Hi, I use the Simple Adsense for my Google Ads and think it perfect for me. BUT I would like to show Ads on the top of my posts but don’t want to show them on the front page summary of the posts.

    How do I work around that?

  • Tobias Nyholm

    I would recommend you to use the function call. That’s how I often use the plugin. Edit your single.php and add this line just before the_content();

    echo getSimpleAdsense(1);

  • Mbj

    Hi Tobias.
    Thank you but I think I need some coaching. It looks like this when I put in the suggested line:

    And the front page like this: 

    Any ideas about what I have done wrong?

  • Pingback: Simple Adsense | Best Plugins - wordpress – widgets – plugin 2012