Have you found it difficult to control the placement of Adsense ads on your site? Would you like to be able to turn one or more Adsense ads on or off for a specific page/post?

Following is a method that can provide more flexibility and control over where Adsense ads are placed on your website.


Defining Custom Fields
So what is a custom field? According to WordPress (http://www.wpbeginner.com/wp-tutorials/wordpress-custom-fields-101-tips-tricks-and-hacks/):

Custom Fields are a form of meta-data that allows you to store arbitrary information with each WordPress post. While this does not sound so powerful, it is the single most powerful component of WordPress posts and content types (aka post types). This meta-data is handled with key/value pairs. The key is a 'name' which identifies the specific field thus it is a constant and should stay the same for all posts however you can use the same key multiple times within one post. The value is the information that will be displayed for the field when you call it in your WordPress theme thus it can change with each post.

To get more detail about custom fields, search for "custom fields wordpress" in any search engine.


Adsense Keywords and Values
There are at least six custom field keywords associated with Adsense ads. These are:

adsense
adsense-top
adsense-middle
adsense-bottom
adsense-widget
adsense-search

Values associated with these keywords include no, left, right, and center.

The "no" value, combined with any of the location related keywords, will restrict Adsense ads from being located in that area of your post or page (top, middle, bottom, or sidebar/widget).

The "adsense" keyword with a "no" value will restrict all Adsense ads from that particular post/page.



Join the Discussion
Write something…
Recent messages
KingRa13 Premium
Do I need to add quotations on the keyword and value? For some reason its not working for me.
Reply
AllynBeekman Premium
No, you shouldn't need quotations. Can you tell me what you have done so far and what isn't working. Perhaps I can help you figure out what is going wrong.
Reply
KingRa13 Premium
So far I have got adsense ads on all my post, which I don't want them on all my post. I went into the custom fields area and added the "adsense" keyword and "no" value to keep the ad from showing on certain pages but when I go back and look at my site live the ads are still there. What am I doing wrong???
Reply
AllynBeekman Premium
I assume you are talking about your plants4fuel.com site, correct? When I go to look at it I see only one Adsense ad at the bottom of your sidebar. This is true on both posts and pages.

Is that what you were hoping for? I checked several posts and didn't see any ads other than the sidebar.
Reply
KingRa13 Premium
Yes that is the correct site, the problem is I don't want that ad to show up in all my post sidebar. I just want to run ads in the sidebar of a few posts and a few posts without ads in the sidebar.
Reply
AllynBeekman Premium
Ok. So, on the posts where you do not want to see the ad, try the adsense-widget keyword with the value of "no". You mentioned you've tried the adsense keyword but was it specifically the adsense-widget keyword? The "widget" is intended for the "sidebar".
Reply
KingRa13 Premium
Yes thats what I entered in and nothing happened the ads are still showing up in the sidebar.
Reply
AllynBeekman Premium
Hmmm....let me do a little research on the internet and I'll get back with you. Not sure why it wouldn't work.

Can you give me the URL of a specific post where you have used the adsense-widget keyword?
Reply
KingRa13 Premium
http://plants4fuel.com/are-jack-lalanne-power-juicer-reviews-really-that-good
This one of the post where I used adsense-widget keyword.
Reply
AllynBeekman Premium
Yes, the ad is definitely there. As I said, let me do some research. Not sure why it wouldn't restrict the ad.
Reply
AllynBeekman Premium
You know, I didn't think this made a difference but perhaps it does. I also use a plugin called Easy Plugin for Adsense. That is where I learned about control fields.

When I go out and search the internet for your issue I keep finding references to the plugin along with the control fields.

Are you willing to add the Easy Plugin for Adsense plug-in? It allows you to define where you want ads positioned (not sure how you did it first). Perhaps the control fields are defined by that plugin.
Reply
KingRa13 Premium
Thanks, I will give that a try and let you know how it works.
Reply
LondonLeigh Premium
Many thanks Allyn.
All the best,
Brandon
Reply
islandcat7 Premium
I would like to know where do I go to get a Ad and copy a code bar on Adsense, so that I can take it to Word Press and paste it in my website. I remember this in previous training, but forgot.
Any help please.
Reply
AllynBeekman Premium
The training lesson can be found at https://my.wealthyaffiliate.com/training/online-entrepreneur-certification-making-money-level-3/getting-paid-for-ads-on-your-site. It will point you to the page to sign up.

Once you are signed up, you will click on the My Ads tab at the top to create your "ads." On the My Ads page, you'll click on the "New Ad Unit" button at the top to specify the type and size of the ad you want on your site.

For example, you may want to allow image-only ads of size 300x250 on your post or page. Or you may want a larger text/image 300x600 allowed in your sidebar. Or you may want both. You define them on this page, then Adsense place the ads on your site.

A WA friend recommended the plugin Easy Adsense, so I installed and initialized it. The plugin allowed me to specify where I would allow ads, in general, on all my posts, pages, and/or sidebar.

Then, I implemented custom fields to add additional flexibility in ad placement.
Reply
islandcat7 Premium
Thanks for your help, i got it, this is what i needed. Thanks again.
Reply
Christabelle Premium
This is new to me yet but this is training I will definitely revisit. I like the presentation!:)
Reply
AllynBeekman Premium
Thanks Christa. Hopefully, it will be useful to you at the right point in time.
Reply
islandcat7 Premium
Could you answer my question above. Adsense has lost me. THANKS.
Reply
Christabelle Premium
I am sure it will!:)
Reply
rob3 Premium
The 'Quick Adsense' plugin is another that does a good job. It gives you access to plenty of different ad scenarios and placements right from the text editor.
Reply
AllynBeekman Premium
Does it allow you to control the ads on a specific page or post as I discuss in this tutorial? That was the key to using the custom fields. I could have 3 ads on one post, 1 on another, none on a third post, etc.
Reply
rob3 Premium
Yes it does! You can insert any number and types of ads anywhere on your site, all from within the text editor. It is done by using shortcodes.

The main ad codes are stored in the Quick Adsense Settings page on the WP dashboard.

Different ads are assigned to certain Ad Names, and these appear as buttons on the editor just below the default text icons. As you position your cursor into the desired location of your text, just click the ad name and the code is inserted.

Very straight forward.
Reply
AllynBeekman Premium
Terrific! Easy Adsense gives very brief instructions about custom fields, which is how I got started using them.
Reply
IMc Premium
Interesting way to do it. What advantage does it have over using an ad manager plugin?
Reply
AllynBeekman Premium
I use Easy Adsense plugin, which allows me to specify where I want to allow ads, in general. Yet I can't change those locations for a specific page. In fact, when I changed my mind and tried to change the location after first initiating the plugin, Adsense just added an additional ad everywhere.

Custom fields allow you to control which locations can be used post by post (see the examples on the 4th page).
Reply
IMc Premium
Thanks Allyn. I know what you mean about the automatic placements not being as you'd wish on some pages.
I can see why your method had its advantages.
Thanks for the info. Something new for me ☺
Reply
Top