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.You may have missed:
Start a blog right away! Already have one? Then make it popular!
If blogging and making money with it has been a long cherished dream of you, and if you believe you have time, patience and a topic of interest to blog about, it's time to kick off your first blog with a perfect domain and reliable hosting. If you already have a blog, make sure you have an outstanding premium theme if you run WordPress. Only content may not bring success; creativity and design matter a lot.
If you're looking for a theme with top quality design and custom options that take no time to change your blog into whatever you like, the best would be WooThemes. If your budget is low, try ThemeForest for great quality WordPress themes at an affordable rate.
On the other hand, if you are more focused and serious in blogging, you should go with some framework. Highly suggested framework is Genesis which is recommended by top class bloggers including Chris Brogan. Headway is another alternative at an affordable price. If you have time to spend for blog development and willing to make it extremely customized, Thesis by DIY themes is also in the list.
If you're looking for more recommendations, check out the Top Services where I compiled a list of services I'm a member of and I found worth using. If you need someone to hand over all the technical stuffs and want to pay attention to content creation only, I'm always at your service. Hit here to find out the services I offer.









[...] Update: If you don’t want to use any third-party plugin for inserting adsense [or any other similar ads] inside wordpress blog posts, you can apply it manually directly to your theme by tweaking your theme. A recent post describes you How to Manually Insert AdSense Ads inside wordpress posts. [...]
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!
I love this article… Thank you very much.
Wow.. that's great..!! I was even searching from a long time, since I too have some of the wordpress blogs, for which I wanna add adsense ads in it, but was running out of idea. Now this is what actually I want. Thanks for the great help. Will implement it and hopefully grab the better results.
Volvo diesel trucks
Thank you for dropping by. Hope you will visit my blog again.
buzz is best for just dropping a small talk has no difference with emailing…
i never thought it would be possible..
this is what ive been trying to learn
Hhe article's content rich variety which make us move for our mood after reading this article. surprise, here you will find what you want! Recently, I found some wedsites which commodity is colorful of fashion.
http://www.thegy.net
its work, thanks
some time i doubt about free plugin that hide something
manually will be beter
In first days, I was afraid of hand-coding. But later I found that it was
damn easy and activating one more plugin slows down my blog somehow. So,
it's way better to place adsense codes manually, although you're required to
do this task each time you change your theme.
[...] But I personally don’t prefer to use too many plugins. You’ll see that I used to place adsense manually and do all other stuffs which are possibly for me to do without any plugins. Too many plugins slow [...]
The best way to get maximum result from Adsense is to place codes manually. If we tend to place that in same place every time our regular visitors will be familiar with those. Another point is not we do not write every post in the same way. In some article we place image at the very beginning. So in that case we can't put adsense code right after an image. So, the best way is to know single line codes to place adsense ads wherever we wish to place in our posts.
Adnan