Adding Google Adsense to Worpress without any Plugin

I was using a wordpress google adsense plugin to add google ads to this blog before I saw something that eventually made me change my mind about adsense plugins. I finished writing a post that day, previewed it and saw one of my ad units in a color I never used. Knowing what could be wrong, I checked the publisher’s ID and saw it was totally different from mine! It was only then I realized I had been sharing my revenue with the plugin developer without my knowledge. It was at that very moment I decided not to use anymore wordpress google adsense plugin and tried inserting ad units manually.


Adding Google Ads below the Menu

- Go to Appearance > Template Editor

- Open header.php

- In the very last line, paste this code:

<div align="center" style="display:block; width:950px; margin-right:0; background: #ffffff;">

YOUR ADSENSE CODE HERE

</div>

I used this to add a 728×90 leaderboard below the header, see that? You should note the following:

width:950px – this represents your blog width. You should increase or decrease this if there’s a need to do that.

background: #ffffff – this is the default background. If you have a dark you should change the color code to 000000

YOUR ADSENSE CODE HERE – Paste your adsense code here


Adding Google Ads below Post Title

- Open single.php

- Locate where the post body starts. If your theme supports thumbnails, it shoul be just before this code:

<?php
if(has_post_thumbnail()) {

- Paste your adsense code just before this.

- If your theme dosn’t support thumbnails, you should paste your adsense code just before this:

<?php
the_content('');

Below is what it should look like:

how to add google adsense to wordpress without plugin


Adding Google Ads Before Comments

Locate this code in single.php and add the code just before it:

<?php
if(comments_open( get_the_ID() )) {
comments_template('', true);


Adding Goolge Ads on the Sidebar(s)

- You don’t need to edit your template to do this, just go to Appearance > Widgets

- Drag Text widget to your desired position and paste your code inside it.


Google Adsense in Other Positions

If you’re not comfortable with editing your template, there’s a way out.Udegbunam Chukwudi of Patchworkoftips introduced a plugin to me. This plugin’s not an adsense plugin but rather a plugin to define how your post layout looks like. Post Layout allows you to use all sort of text, html, javascript anywhere in your posts and I recommend it.



Get free daily email updates!

Follow us!


Tags:

<?php if ( comments_open() ) : ?> wordpress, how to add floating share, adsense under post title wordpress tricks, insert song in wordpress template floating, how to place adsense below post title wordpress admired, what code do i use to wrap my text around my ad inside my content post for 2012, google adsense below title align, insert adsense inside post without plugin, how to place ads in wordpress admired theme, insert adsense on wordpress 2012 without plugins, insert adsense without plugins, how to add google adsense mobile php code, insert adsense in wordpress template, inserting adsense above the body of the post in wordpress, wordpress insert ads below menu, wordpress adsense before post, where to add adsense code in content text for 2012, plugins to add Adsense code to wordpress, plugin for wordpress to insert adsense in header in center, plugin for adding adwords ads
avatar

Don Caprio

Don Caprio is a part-time blogger living in Nigeria and apart from blogging, his other obsession is hip-hop music. :) You can follow my updates on Twitter or add me to your circles on ! You can as well grab my feed and get updates through email.

More Posts - Website

Facebook Comments

Facebook comments

Related posts:

  1. Inserting Google Adsense, Inmobi and Admob Ads in WordPress Mobile Version
  2. What is Google Adsense?
  3. How to Add Google Adsense Below Blogger Post Title
  4. Adding Floating Share Buttons To WordPress Without Plugin
  5. Google Adsense For Mobile Now Available in Nigeria and 14 Other Countries
  6. How Many Google Adsense Units Are Allowed Per Page?
  7. Google Adsense For Content Now Displays on Opera Mini and Other Mobile Browsers
  8. How To Cheat On google Adsense
  9. Fastest Way to Get Google Adsense Approval For Blogspot Sites
  10. Google Adsense Approval Tips for Blogspot Blogs

5 thoughts on “Adding Google Adsense to Worpress without any Plugin

  1. Thanks for this update, have been expecting a post on this earlier but had a work around pasting my ads below post. Geez most of this plugin developers are crooks!!! Myself never intended using a plugin for my ads before. Thanks once again for this update! Cheers

    • If you want to wrap your text around the ad unit, use this:

      <div style="float: left; padding: 5px; margin: 5px;">ADSENSE CODE HERE</div>

      You can change float: left to float: right.

Leave a Reply

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

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Commentluv Enabled