How To Get Google AdSense and Display Ads on Your WordPress Blog

Want to get advertising in your blog and make some money while at it? Great, I’ll show you how. At least how to set it up that is. Getting significant money might be another thing, but you only get $0 if you don’t try it, right?

Why Google AdSense?

It’s not the only way, but it is the EASY way.

If you want to get advertising to your blog, the most simple way to do it is to ad Google AdSense ads to your blog. Getting Google AdSense for your blog is quite simple, but here’s super simple how-to for getting those ads up on your WordPress blog.

In this post, you’ll find out:

  • How to get ad code from the AdSense control panel (easy)
  • How to insert the code in your WordPress blog theme (advanced / hard)
  • Learn how you can display the ad on top (or below) of each post, or in the blog footer or on each post on your front page, etc.
  • How to display the ad using Widget in your blog (very easy)
  • List of WordPress plugins you can use to automatically insert the ad code to your blog where you want the ads to be displayed  and manage your advertising and AdSence ads.
  • Learn to get ads to your BlogSpot blog
  • Learn why you should move to self-hosted WordPress, if you’re using WordPress.com
  • and much more, in a simple step-by-step tutorial with screenshots

How To Join Google AdSense

Go to the Google AdSense -site and join up, if you need instructions or help, check the Google Help for AdSense. After joining and getting familiar with the interface by browsing and using the tutorials and help on the site (which are quite excellent by the way), you can move on…

Getting the Google AdSense Code from AdSense control panel

1 Setup AdSense for Content & Choose Ad Type

  • Click on the “AdSense Setup”
  • Click on “Get Ads” if it didn’t open as default
  • On this screen you can choose what kind of ad you want to create
Choosing the Ad Type

Choosing the Ad Type

  • Ad Unit” can show both images or text ads on it,
  • Link Unit” has only text links.

In this example, we choose Ad Unit as we like to create a banner ad.

2 Set Format, Colors and Other Parameters

After choosing the ad type you want, click Continue…

Now you get to choose the format, color and other options for your ad:

Select Ad Format, Colors and Other Options

Select Ad Format, Colors and Other Options

Select values and  color you want and set the options for this ad unit:

  • What kind of ad unit you want (e.g. vertical/horizontal banner, small box, etc.),
  • select color “Palette” from the selection or create your own,
  • select font and ad block shape (rounded corners or not, etc)

In this example we choose 468×60 banner with default Google Palette and Verdana font.

3 Set Ad Channel for The Add

When happy with ad format, color and the other options, hit Continue again..

Now you can choose an existing channel for the ad, or create a new channel like this:

Create a new channel for your ad or choose one of your old ones

Create a new channel for your ad or choose one of your old ones

Here, we create a channel “zemalf.com”. Channels can be used by advertisers to focus advertising on your channel, and you can edit the description of the channel if you want. Focused advertising is mostly used for bigger and focused sites, so if you’re just starting this doesn’t matter much, but the channel is there “when your blog is huge” if you will..

4 Name the Ad Unit

Again, after setting the channel or channels, hit Continue. Now, name to your ad unit.

This name will help you find the ad in your control panel and the name will go into the code as well as html comment:

Name Your Ad Unit to Find and Track it Easier in AdSense

Name Your Ad Unit to Find and Track it Easier in AdSense

The name of the ad unit will be visible on your control panel, so it’s worth it to name the ad unit in a way that you can easily see what kind of unit it is and where you are using it. For example, “zemalf.com 468×60 for Articles/Footer/Header” or such.

5 Submit and Get the Code

After naming the new ad, you just have to press “Submit and Get the Code“, and copy the generated code where you want to display it. On the next part you’ll see an example where you can insert the code in your WordPress and show the ad in your blog.

Copy the Code and Paste It Where You Want To Display the Ad

Copy the Code and Paste It Where You Want To Display the Ad

You can always go and get the code again from the “Manage Ads” page on your control panel if you need to get the code again for this ad.

Adding the Google AdSense Code to Your WordPress Theme

You can choose one or more places for your ad, but I recommend choosing one place / AdSense code, as you can then track the performance of the ad unit from the control panel (e.g. how many times that ad unit has been displayed and how many clickthroughs you have got with that ad and place).

If you are comfortable with editing your Theme php-files, go to the Theme editor (Appearance – Editor in WordPress 2.7.1)

WARNING! editing your theme files directly might cause problems on your site, so do this only if you know what your doing. There’s easier and better way to do this with widgets and/or plugins, so this is just to show how it’s done if you really want and need to…

Option 1 Displaying the Banner After Each Post On Your Blog Frontpage

  1. Go to the theme editor and open the index.php.
  2. Find code like this (it might be a bit different, depending on your theme):
    while (have_posts())
  3. Then look for this code after that “while”:
    <?php endwhile; ?>
  4. This is your “post loop”, so if you want to display something before or after all posts on your front page, you can place the code inside this while-endwhile loop.
  5. To get the ads on top of each post, copy the code just below the “while (have_posts())” line.
  6. To get the display the ads after of each post, copy the code just above the “endwhile” line.

Option 2 Getting the Banner To Show Below Each Individual Post

  1. Open single.php if you theme has one
  2. To display the ads on top of the post, copy the code just below “while (have_posts())” line.
  3. To display the ads below the post, copy the code just above the “endwhile” line.

Option 3 Displaying the Banner in the Blog Footer

  1. Go to the theme editor and open the footer.php.
  2. copy the code just above the </body> tag/line.
  3. or inside/above <div id=”footer”> or such, if you want to display it higher.

Option 4 Place the Code Using a Plugin or Widget (Recommended)

Editing your template might be a bit tricky and you have to re-do it if and when you update or change your template, so you should definately use either widgets or spesific plugin to add the Google AdSense code to your blog.

How To Use a Widget to Display Your AdSense Ads:

  1. add “text” widget to the sidebar or any widget area your theme supports and
  2. copy-paste the AdSense code to the widget (mind that the ad unit must be correct size for that widget area/sidebar),
  3. save
  4. done

Your code is now safe from any Theme updates and you don’t have to worry about breaking anything by manually editing the .php code.

In case you want more controlled way on displaying the ads and more control on how they are displayed, I recommend that you use a ad managing plugin…

Displaying Google AdSense on Your Blog Using a Plugin

With a WordPress plugin or plugins designed to manage ads or even spesifically Google AdSense code, you can easily insert ads whereever you want in your blog and change the ads and placements with ease…

Here are some examples of plugins that you can use to manage your ads (they work in different ways, some offer easy way to manage the ad codes, but do not place them in the blog, others just place the code, some do it all). Go to the plugin homepages to learn more:

Some of these are easier to use than the others, and I won’t go through these on this article. Go ahead and try them, or share your experiences in the comments if you have used or are using these or some other pluging to manage your blog advertising.

AdSense in BlogSpot and WordPress.com blogs

If you’re using free blogging platforms like blogspot or WordPress.com, you can have ads in your blog too.

In BlogSpot/Blogger, as it is run by Google, it is almost automated for you, just click “make money” or “earn” kinds of links in your blog settings, and the system will set you up with AdSense.

With WordPress.com, you’re in bad shape. As far as I know, you can’t have AdSense in there, as the widgets don’t allow javascript in them. So I recommend you setup your own, self-hosted WordPress.org based blog.

Unfortunately, I haven’t used other blogging platforms, like TypePad, so I’m not aware of advertising options in those.

How AdSense Works and Will You Make Money With It?

First of all using AdSense is the easiest and the most simple way to get advertising on your blog. There are plenty of other options, but the easiest is definately this. You can make hundreds of thousands of dollars per month with AdSense or you might make zero or couple of cents. Of course, I hope you make a boatload of cash with AdSense in your blog, but in case it doesn’t work for you, look for other means to monetize your blog.

If you need more detailed information on how it works, check the Google Help for AdSense, but in short: AdSense will customize the ads based on your website or blog content, so in case your content and/or niche is right and you have plenty of readers, AdSense can gain you nice income. But like said, without much traffic or “advertising-friendly” content and audience, you might not make much.

Only way to see what kind of results you and your blog can achieve, you must try it and then decide if it is good for you. Just remember to test different kind of ads and add placements on your blog. When you have enough data to analyze whether or not you should continue with AdSense, you can decide if you should look for other kinds of ways to make money from your blog.

Add Google AdSense to your blog and start testing different kind of ad blocks and ad placements to see how it works for you. Don’t go into conclusions too fast if you don’t get many clicks, especially if you don’t have a lot of traffic. After getting the ads up on your blog and seeing how they do, drop back here and share your results in the comments.

Until next time, I hope this tutorial was useful for you!

Share and Enjoy:
  • del.icio.us
  • MySpace
  • Digg
  • Reddit
  • StumbleUpon
  • Sphinn
  • FriendFeed
  • Technorati
  • Identi.ca
  • LinkedIn
  • Propeller
  • Mixx
  • HackerNews
  • Tumblr
  • Google Bookmarks
  • Ping.fm
  • Posterous
  • email
  • RSS
Related posts
  1. How To Manage Ads and Track Clickthroughs with AdRotate Plugin in Your WordPress Blog
  2. How I Made One Dollar and 88 Cents ($1.88) With Google AdSense!
  3. How To Combine Google Custom Search and AdSense with the Default WordPress Search
Topic: Blog Advertising
Tags: AdSense, How-To, Make Money Online, Tutorial, WordPress
| Antti Kokkonen | View Comments

Comment policy: We're gonna be like little Fonzies here. And what's Fonzie like? Cool. Correctamundo, and that's how we roll here -- cool. Critical is OK, but if you're rude, spam or otherwise misuse the blog comments, I will delete your comment. Do not put your URL in the comment text. Use your PERSONAL name (yourname@example is cool, example.com without your name is not). Have fun, be excellent to each other and thanks for adding to the conversation!

  • Gordon
    Is there a trick to getting adsense to show more relevant ads on the index.php page? My adsense is showing ads related to the very first post I created and have since deleted. The ads will not change regardless of the surrounding content. The ads do change, however, on other pages.
  • In general, it's harder for the AdSense system to figure out the relevant ads for the front page if it keeps changing, but I suggest you check the Google AdSense help for "why my ads are not relevant" at http://adsense.google.com/support/bin/answer.py... and the section targeting at http://adsense.google.com/support/bin/answer.py...
  • Tim
    Hi,

    Thanks for the info! Great Site, I have bookmarked you!

    Respect

    Tim
  • I appreciate the comment, but unfortunately I had to edit it. Spamming won't get you anywhere. If my comment rules say you shouldn't add your URL to the comment text, you don't add the URL to the comment text without a very good reason, right? I should've just marked your comment as spam, but take this as a warning.

    If you need help with GOOD blog commenting, check this post of mine: http://zemalf.com/1082/advanced-blog-commenting...
  • Thank you so much for this. Worked like a charm.
  • I needed this, thank you for sharing this information.
  • This is a great way to show bloggers how to insert the Google Adsense code into their blogs!

    Great to see you help out the community. Look forward to reading more!
    .-= Brad Ney's last blog ..BradBlogging’s 2nd Anniversary Makeover With A New Design and Mindset =-.
  • Thanks Brad, I'm glad you enjoyed this one -- I'm planning on adding some more advertising/AdSense posts on the blog too, but this is a good starting point if one is not familiar with AdSense at all.
blog comments powered by Disqus