It’s been said that monetization should be done in moderation without appearing too obtrusive to your readers.
One of the most common approaches is to insert ad banner or adsense within the post. In-line ads are perceived to have one of the highest click-through-rate (CTR).
Now what if you do not want to show ads on posts within certain categories? In some instances, what if you want to remove ads on all your sponsored reviews?
WordPress Hack
In my search to find the possibility to do so, I’ve just discovered a nice little hack that removes any ad from any category.
I’m not too sure if this function is going to serve any real purpose to you but in the spirit of sharing, I’m going to show you how to do it in WordPress.
Insert your ad banner or adsense code here
In the above code 15 and 23 are category IDs, replace them with the IDs of the categories you don’t want ads in.
If you are clueless, here’s how to check your category ID
I am currently using this code to remove private ad from my Review categories. Probably by doing so, I’m giving the maximum exposure to the advertisers who ordered my review.
Source: JohnTP
post scriptum
Since php and me don’t seem to go along well most of the times, I’m asking anyone here if it is possible use if/else statement within the code.
What I’m trying to do here is to show adsense on one particular category and private ad on the other.
update:
John from The Mobility Tiger – a site that talks about health and mobility issue – has shared with us a simple php hack and here’s the code for the if/else statements.
Insert your ad banner here Insert your adsense code here Insert your ad banner or adsense code here
All you need to do is to change the word ‘false’ to whatever you want to test for. In this case the category ID.
A big thanks to John for sharing.
Related posts
- If You Have Adsense, Use Section Targeting Without a doubt, the easiest way to monetize your blog is by use of Google Adsense. Not only it takes...
- Publicity Wheel Can Boost Your Blog’s Traffic In a BIG Way This is a guest post by Mark Schumann, the owner of the Publicity Wheel. Have you ever experienced Digg or...
- Google Hates Duplicate Content – The Fix If you are new to WordPress, you will notice that your post content will be displayed or I should say,...
- WordPress Template Tag What is a Template Tag? It is a php tag used within your blog’s Templates to display information dynamically. Say...
- How To Add Post Date To Your List Of Recent Posts The WordPress function wp_get_archives(’type=postbypost’) displays a lovely list of posts, but sadly to say, it won’t show the date of...
{ 28 comments… read them below or add one }
Sorry about the formatting, I tried to make it readable, but you could do something like the below, using ‘else’ and ‘elseif.’
Just change false to whatever you want to test, in this case the in_category test.
Right now it would print the last else statement, because both of the tests are false.
AdSense Code 1
AdSense Code 2
AdSense Code 3
Tiger´s lastest post..Scuba Diving for the Mobility Challenged
So that comment originally had a php snippet in it, but I guess wordpress doesn’t like putting that in a comment. If it doesn’t show up let me know, I can email it or something, but basically else and elseif is what you were looking for…
Ooops! The demon is eating up the code again. Anyway, I’ve just emailed you….hope it doesn’t goes into spam….
Thanks for your input and glad to take time to visit.
Yan
Nice post, Yan! I have a made a few similar posts on WpRecipes.
jbj´s lastest post..How to: create an ads rotator with php
My bad! How could I forget that you are the master of WordPress hacks…;) Let’s see what Tiger has got to say, if there is none I’ll probably jump over to your forum for the code.
Thanks for dropping by…
Yan
Ah if only I had discovered this trick when I had my last blog. Oh well. But this is going to be useful for me later down the line, bookmarked.
Alex Fraiser´s lastest post..When you think a website is down…
So what happen, Alex? You sold your last blog?
Yan
Yes, I sold it. I have a new blog in the works, so I will be sure to use this trick on it.
Alex Fraiser´s lastest post..Finding the source of an argument…
nice, maybe I will use this post as my reference when my blog already have ads on it.. Nice
newbiesblogger´s lastest post..My Blog Is Suckzzz!!!
Great post..,thanks
MoneyBlog´s lastest post..How to Actually Rank For Any Keyword With a Legitimate Search Engine “Loophole”…
Looking at code makes me feel lost. Is there any plugin that allows us to specify on which categories the ads should appear and on which they should not?
Ganesh´s lastest post..Commenting My Way to Success!
Tell me if you found one, Ganesh and share it with us here. Probably there is but I’m yet to find one…
Yan
I saw this one on the reader and I thought ‘here is one I know the answer to.’ When I opened the site I found that Tiger had beat me to the punch – shucks!
Lyndi´s lastest post..Blog Review: http://www.Rarst.net
Thanks for dropping by, Lyndi. You seems to know your stuff well, huh? I wouldn’t mind if you share with us here..
Yan
Yan! This wordpress hack is awesome.
“I am currently using this code to remove private ad from my Review categories. Probably by doing so, I’m giving the maximum exposure to the advertisers who ordered my review.”
Well done!
Best Regards
Unique Blogger´s lastest post..Twitter, Promote Your Blog or Website
@Unique Blogger
Glad you like it. By the way, I wish I knew your ‘unique’ name, buddy….if you don’t mind…
:D In next your post i will sing my name bellow comment :D
Unique Blogger´s lastest post..Twitter, Promote Your Blog or Website
Thanks for sharing this and also thanks to tiger/Lyndi for another way of doing it with the in_category.
I don’t see why I would use it right now as I don’t run in-line ads I want to remove for specific categories, but I keep the article in mind if I ever need to do it.
Thanks for sharing yan!
Ben “the frog” Tremblay´s lastest post..Offline marketing: I see huge potential
Nice one Yan!
Thanks for shring it with us. I will implement it on my blog :)
Farrhad´s lastest post..Things You Must Do Before You Turn 40
Great Hack! I didnt even know that adsense has a strong CTR when it is inline. Anyway I dont want to put ads in the middle of an article. I think it is too invasive and can be perceived as a “moneymaker” for the webmaster. What i do instead is to put ads at the beginning and at the end of my post. to do it i just use a code that i put in the theme’s loop (no plugin). Your hack is really nice anyway. I am going to speak about it!
Web Talk´s lastest post..Download a video editor, photo/video converter for free
Awesome little hack buddy…although I’d probably have to have someone else do it for me. ;)
Dennis Edell´s lastest post..Are You Able To Focus & Take Action? A 5-Step Plan That WORKS.
Hey Dennis,
Let me know whenever you need an assistance. I’ll always be there…
Yan
I hope this code will be usfeful for removing the ads from review categories.
A very handy trick for beginners. Though there are several plugins for adsense that can easily do this.
Thanks! It was really a great tip for a beginner like me. Thanks for the trick
Diana Rupert´s lastest post..7 Secret Tips to Rapidly Lose Weight
Thank you so much ! Yan I think it was really good tip for me and everybody. God bless you.
MR.Nan´s lastest post..Mycapitalonecard.com
I have never done this nor did I never know how to do it. I looks pretty easy enough though. Thanks for the tip.
I do have to mention though that by getting rid of your advertisers are you making it up for them? I mean after all they do pay to advertise on your blog? Unless of course you are only removing AdSense then it’s no prob. Just wondering from an advertisers perspective.
Thanks for the little tutorial Yan.
IronBlogger – Blogging Tips and Tricks´s lastest post..Create A Pop Up Form With Aweber
yes inserting code with in the text cause high ctr, however use good and matching color scheme to full fill your users reading interest