censoring yourself for Google AdSense…

October 13, 2016 7:08pm
Tagged with:

So the other day I got an email from Google AdSense that was frustrating, to say the least…

screen-shot-2016-10-13-at-6-47-54-pm

…frustrating because admittedly until earlier this week, I haven’t even posted anything to Just Laugh for a good six months, so for the most part it’s barely even on my radar. Yet I use the same Google AdSense account for all of my sites and I don’t really want to get the thing suspended … what, for the whopping $100 in ad revenues that I somehow collect every year or so at a couple of bucks in random visitors each month! 😛

Also, it’s stupid because the post that apparently flagged this “mature content warning” was published a year and a half ago and never got a complaint until now, but whatever…

Now I just use simple text widgets to insert AdSense blocks around Just Laugh and being a WordPress site, it’s all done through templates so it wasn’t easy to just “remove ads from the violating pages.” I looked around, but surprisingly didn’t find any plugins that would allow you to omit specific URLs from receiving ad code, and apparently AdSense itself doesn’t have anything either – you can block advertisers, but not specific content on your site.

This seems weird and dumb because no doubt there are plenty of sites that publish “adult content” with “adult” meaning 18+ … not for kids and not here’s where you can buy vibrators and inflatable sex toys!

…I wonder if just mentioning those words will get this blog post flagged … in a year and a half…

Anyways, I found this simple write-up that basically has you create a new custom field and then uses an if/else condition in PHP to determine whether or not to display the ad code that you choose…

Show or Prevent Adsense ads on Selected Posts in WordPress

It’s not perfect – at least not in my layout – because I suppose if I really cared that much I wouldn’t want the Sponsors widget to display at all if it’s going to be empty anyways. An alternative would be for me to insert a house ad or something into that block so that it isn’t empty for that one post, but honestly according to my stats this specific post has gotten viewed a total of 39 times since it was published last spring, and 8 times this year … so I really don’t care right this second as long as it prevents Google from suspending my account whenever they get around to rescanning the page! 😛

One note – if you use a widget-based solution like I do, you’ll need a widget that can parse PHP because the regular Text widget in WordPress doesn’t and I made that mistake the first time around, not noticing it until I reloaded the page and saw the actual code everywhere. Fortunately I already had the Enhanced Text Widget plugin installed and it works great.

I suppose if I get more notices down the road about other inappropriate content, I can go back and add alternate ads to load as I flag the new posts, but if you just need something quick and dirty because Google randomly crawled an old post and is complaining about it, this works just fine in about 10 minutes time. 😉

jl_clean

Leave a Reply

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

© 1999 - 2018 Comedic-Genius Media, All Rights Reserved.