Life with Technology

Help Those Mostly in Need

Sometimes, God wishes to play cruel with us. Putting unavoidable troubles on the poor is just one kind of them. Recently, we've watched what happened in Haiti. It's very sad that there are still countless people dead or alive buried under the collapsed buildings. Although days have been passed, the people in Haiti couldn't recover the heartbreaking loss and one of the worst devastation we've ever seen. They in fact can't unless every person with ability spreads the helping hand. Ask yourself, isn't there anything you can do to help those mostly in need?

17 September 2009 Comments

How to Manually Insert AdSense ads Inside WordPress Posts?

A long time ago, when I first entered into the blogging world with a serious motivation of doing business, I was thinking how to place adsense ads inside wordpress posts. I knew there are a number of plugins available out there. I used some of them but unfortunately I didn’t find them that much useful. I wanted a plugin which will let me put ads inside wordpress posts.
I have a habit of telling people whatever I learn in blogging world. And that’s why I wrote a post featuring the easiest way to put adsense inside wordpress posts using plugin. The plugin was really useful and still I am using this.
But recently I noticed a lot of people are concerned about using third-party plugin to put adsense inside wordpress posts. Maybe they are worried about their adsense account. Well, putting adsense ads inside wordpress post manually isn’t that difficult. There was a time when I was afraid of coding. Still I don’t know coding; but inserting ads inside post using wordpress theme editor is truly simple. It’s like: You copy the code of adsense unit from your adsese account, and place it in the proper place of the theme. That’s it!

So Let me Tell You How to Do that

Go to your WordPress theme editor under Appearance menu.
Make sure you’re editing the theme currently being used in your blog. For example, if you’re using “WordPress default” theme, you’ll see it selected in a drop-down menu at the upper-right corner of the screen.

Choose the File

A theme consists of numerous files. You will see the list of files at the right side. Click on the file that is named as “Single Post (single.php)“.
The source code of that file will be shown in the screen.

Pasting the Code

At the Top of the Post:
Find out the following line in the code (Use Firefox Find option for faster search. Ctrl +F):

<div class="entry">

You need to paste the adsense-given [or any other ads'] code directly right above this line. This will place the ad unit right after the title of your blog post.

At the End of the Post:
Alternatively, or along with the top one, you can also place adsense or other ads right below the post (where the content ends). For this, find out the following line in the source code (in the file single.php) and paste the necessary codes right above the following line:

<?php comments_template(); ?>

This will make your ad unit appear at the end of the post. Please note: If you are using “Related Post” plugin, the unit may appear below that. In that case, you are suggested to take advantage of the old plugin “All in one Adsense and YPN“.

Two Mentionable Things

1. Be careful; this might harm your blog: If any thing, no matter how silly that maybe, goes wrong, your template may become faulty. So, before you apply this manually-adsense-insertion method, make sure you’re trying it on a useless blog. I suggest you have another wordpress blog hosted on any free hosting so that you can experiment anything on that blog. If anything goes wrong, no valuable information will be missed [as nothing valuable exists there].
2. Not only Adsense ads: Bidvertiser, Adbright, etc lots of other Pay-Per-Click ad serving companies are available out there. This way you can place ad unit from any company. It isn’t limited to adsense only.

Share the knowledge

If you agree with me that this is a helpful post, ;) then do not forget to be kind enough to promote it on social medias and share it with your friends and colleagues and neighbor bloggers. Just hover your cursor upon the Share button and you will find options to share it right with a click. Also, retweet the post to share the knowledge among others.

Have your say

Are you showing adsense [or relevant] ads in your wordpress blog? Did you manually place them or using plugin? Which one you think useful? Do you agree it’s not safe to use third-party plugins for inserting adsense ads? Share your mind with me and my readers.

Did you find this article useful? Did this help you anyway? Is it worth rewarding me for it? Please support me to keep this work up.

Please Share this Post with your Friends:

  • Add to favorites
  • Facebook
  • Digg
  • del.icio.us
  • Google Bookmarks
  • StumbleUpon
  • email
  • FriendFeed
  • MySpace
  • NewsVine
  • Ping.fm
  • Technorati
  • Reddit
  • Twitter
  • Live
  • Yahoo! Buzz
  • Tumblr
  • PDF
  • Print

More on this topic:

  • Hey Aisajib, what host do you use with wordpress? And how much are you earning with this blog?
  • Probably this blog is hosted on hostgator. I'm unsure because it's
    hosted on a shared hosting.
  • Placing an AdSense ad inside a post will definitely help the publisher to get a better click-through rate. However, one has to be cautious that it does not become too obtrusive or irritating to the readers. Luckily, you have suggested placing the ad inside the post but just below the heading or just above the comments, but not directly inside the text of the post (some sites are doing that too). Though many persons are putting ads just below the heading of the post, some persons find it irritating. Putting at the end of the post and above the comments would not irritate the readers as by that time they would have already read the post.
  • I agree with you. Publishers should bear in mind that the ad should not annoy readers. But placing ads right below the title is a recommended idea that most bloggers do. So, I think readers are used to in watching ads right below the headlines.
  • hey ! interesting post but it seems the code extract don't show up anymore.
    Could help me out with this ?
  • Dear netgui,

    Thank you very much for your comment. I do not know how, but the plugin I was using to highlight codes was unexpectedly deactivated. Now, I have added another plugin to highlight codes and it is working fine now though the font size is too low due to uncertain reason.


    I really appreciate your comment on the problem that I didn't notice earlier.
  • Hey there ! Thx for your quick answer ! Happy to help you.

    I've a question you may be able to solve by the way. I'm trying to insert an Adsense tag inside a wordpress post, but not on top or below but really inside the post, on the top right corner of each. Would you know how i should modify the theme for doing this ?
  • If you are having trouble putting adsense in anywhere you want, I recommend you using The best plugin for AdSense inside wordpress post I have seen so far. This will not only handle your adsense color, size and other things, but also let you insert ads wherever you want inside of your post.

    Give the plugin a try. I hope that will solve out your situation.
  • Wow! This is such a cool development! A very nice article you have written.I appreciate the helpful tips and will tell my friends!Thanks for sharing!
blog comments powered by Disqus
Get Adobe Flash playerPlugin by wpburn.com wordpress themes