Google Adsense: easy Section Targeting in WordPress

If you’re not satisfied with the relevancy of your Adsense Ads (and thus your CTR), try section targeting: inserting a start and end html comment to mark the relevant content sections of your page.

A very easy way to do this in the WordPress default Kubrick theme (or themes derived from it):

  • insert <!-- google_ad_section_start --> at the bottom of header.php of your WordPress theme
  • insert <!-- google_ad_section_end --> at the top of sidebar.php

Or vice versa, if you think your navigation is responsible for leveling down ads to your site’s lowest common denominator contentwise, and the myriads of worthless ads for free blog and photo sharing sites, decrease your sidebar’s importance by

  • having the just inserted ad_section_end at the top of sidebar.php followed by <!-- google_ad_section_start(weight=ignore) -->
  • closing that section again with <!-- google_ad_section_end --> at the bottom of sidebar.php

Or you might demote the comments by closing the ad_section and reopen a “weight=ignore” one before in comments.php etc…

Still this leaves us to wonder: wasn’t Google the company with those intelligent algorithms who could determine that, let’s say an identical bunch of links that appears on (almost) every page probably isn’t really fundamentally important for the content of one particular page? And that text in small font further down the html source probably matters less than the chunck of text that reiterates the title? Hmm… they’re not trying to fool us into playing the bad guy, are they :-) …

(via Jensense, the always very well informed expert on contextual advertising.)

13 Responses to “Google Adsense: easy Section Targeting in WordPress”

  1. Dexter Says:

    neat trick.

  2. Edwin Says:

    Thanks. I was looking for this exact info.

  3. Share Video Says:

    Valuable info. Hope it will help to get the target adsense content.

  4. David Bradley Says:

    Strangely enough, the ads being served on each post recently have looked more targeted than ever before. That said, this is a cool trick if that’s not the case for your site. I’ve implemented it regardless just to see if it pushes the CTR up a little further.



  5. Stuart Says:

    I’ve found Section targeting really helps with blogs that use dynamic URL’s. Otherwise you should try & use the Permalinks aswell to get more on point targeting :)

    Earners Blog

  6. Michael Sherriff Says:

    I didn’t even know you could mark the sections of your text. This is a really neat ‘trick’. I use Permalinks too so these two added together should ‘pep’ things up a little on the CTR front ;-)

  7. David Bradley Says:

    regarding the algo, I don’t suppose it could be that they run different ones for different purposes – one for generating SERPs, t’other for identifying targeting for ads? In fact, I’d propose that they most certainly do, the SERPs one will be far more robust and insistent.

    Anyway, adding the weight ignore statement into sidebar should help my static pages, I hadn’t thought to do that before and it saves adding the section tag to hundreds of pages outside my standard template framework. Thanks!


  8. Goldy Says:

    I can’t use it! googlepages automaticly delete the code & google dowsn’t seem to care.

    Help me please.


  9. yogi Says:

    i dont understand how to insert ads of google in mine wordpress blog…plz tell me step by step….
    thank you.

  10. Kriszta Says:

    It took a while to find this info on Google section targeting to mark the relevant content sections of our page, and this way making Adsense ads more relevant to the content… but it was so worth it! I just placed the codes to my WordPress theme, so the ad relevance testing experiment has begun! I hope I figured out where it is best to place the codes on my Revolution Magazine theme.

    Due to the long list of topics on my sidebar, my current ads are totally irrelevant (they are all about hotels and apartments) so IF they change to match each article, this method is a winner!

    I read on the Google site that the change brought about by section targeting codes might take a while, since Google ‘remembers’.

    Pick an article on my site and see whether the ads became relevant yet:

  11. Paul Says:

    That really is a great tip, will report back if my CTR manage to increase somewhat, thanks again!


  12. deni Says:

    is this code against adsense tos??? will this code remove the public ads service ?


  13. Photoshop Says:

    No, it’s not against adsense TOS, the code comes from google.

    Thanks for instructions on where to put the code.