One of the many reasons I switched to WordPress was for the flexibility that WordPress has to offer. As most of you may know, I’m a member of the BlogHer Publishing Network. One of the terms of the network is that BlogHer ads not be displayed next to third-party sponsored content, such as those from Social Spark, Social Fabric and others. When I was on Blogger, I had to create a separate review site for these sponsored posts, per the tutorial by BlogHer. Then I learned I could hide BlogHer ads on WordPress.
But why would we need to do that?
The reason Social Spark, for example, chose your blog from one of many to feature the sponsored content, was because of your high pageviews. If you’re on the Blogger platform and you post that content on a review site (and we’re all going to assume it has significantly less page-views than your main site), then it’s safe to assume that this sponsored content has less pageviews. Why? Because you only post on there when you have a sponsored post. Once or twice a month, maybe?
Basically, this is a different site than the one approved by the third-party network. And then the third-party network could tell you, “Sorry, you’re gonna have to choose between BlogHer or us.” And that very thing happened to me. Obviously, I wanted to have my cake and eat it, too.
This created an extremely frustrating experience for me when I had sponsored posts. But I had heard somewhere that if I was on self-hosted WordPress I could hide BlogHer ads (and even swap them with Google Adsense ads) for sponsored posts.
It became a little more complicated for me because, at the time, I also used Genesis Simple Hooks.
So without further ado, here’s how you can do this on WordPress AKA having your cake and eating it, too.
Categorize all Sponsored Content
I find it easier to label all of my sponsored content by using Categories and Tags. A category is a broad topic, like Recipes, and tags are descriptors that help you organize those categories, like brunch or appetizers. Do you need both? No, but it’s my personal preference to have them. (FYI: Blogger names them Labels and Tags, respectively).
So, for simplicity, I lump all of my sponsored posts into a really super creative category: Sponsored Post. See? Super creative. But it helps me organize everything. This shows up at the bottom of all my posts, deliberately. The FTC requires that you disclose sponsored posts, and while I already do that at the top of every sponsored post, I choose to also have it here.
After you have the all the sponsored posts organized under one category (or tag), there are a few ways to hide BlogHer ads in widgets or in Genesis Simple Hooks.
I. Using JetPack
Jetpack came out with a nifty update to let you hide certain widgets on your sidebar. It shows or hides them based on your Categories. I prefer not to use this method as JetPack can bloat your site, (and it’s also limited to categories; you can’t use it on tags) but if you only have BlogHer ads on your sidebar, you won’t need to mess around too much.
Here’s a great tutorial on how to customize your sidebar using JetPack.
II. Using Widget Logic
You will need to download and install the Widget Logic plugin. This plugin can use PHP language to hide widgets based on category and tag ID numbers. When you activate the plugin it will create an additional content area in each widget where we will add a bit of coding.
If you use Genesis Simple Hooks to put BlogHer ads elsewhere (like before or after your header), getting the following information will be beneficial to you, as we will use similar coding in the Genesis Simple Hooks.
1. Find the Category ID
The first thing you need to do is find your Category ID number. On your WordPress dashboard, go to Posts > Categories, and then search for the category you chose for sponsored posts. (Note: it can also be a tag if you so choose. This will not affect the following steps). Keep this number handy for the next step.
2. Insert WordPress Conditional Statement
Okay, that sounds super fancy but it’s really easy. We will be using a formula where you swap out the # with the number WordPress assigned to your category from step one and pasting into Widget Logic as follows:
What we’re doing here is using a conditional statement to display the Text Widget if:
- We’re NOT (!) in a single post (is_single) that also (&&)
- Falls under Category 11 (in_category)
Here’s the code to paste into the Widget logic area below your BlogHer ad code. Be sure to replace # with the category (or tag) number.
Hit Save. If you only have one BlogHer ad, you’re done!
Check your work by going to one of those sponsored posts. Your BlogHer ads should not be visible.
If you have Swoop ads, you will need to place this coding in the post as well:
3. Replace with different ad (optional)
So, if you’re not making money with BlogHer on this sponsored post, but you still want to make some money using Google Adsense or another ad network, there’s a way around that. It looks like this:
What we’re telling WordPress here is:
- SHOW this when it is the archive page for category 11 (is_category(#)) or (||)
- It is a single post (is_single) that’s also (&&) in category 11 (in_category(#))
In this situation, you’ll add your ad code into a new widget. Here’s the Widget Logic code you can use for this new widget:
(for Genesis Simple Hooks, view the next page)