Adsense Section TargetingEarlier I wrote about What is Google Adsense Section Targeting? in this post I’ll show you how you can implement it in your WordPress blog.

We need to do section targeting on pages where the Adsense Ads are displayed to show more specific content related Ads, for eg. Single/ Post Pages in WordPress.  To get effective results we must target post title and post content, and ignore sidebar and comments.

Procedure to Implement Adsense Section Targeting in your WordPress Blog

I have chosen the default WordPress Dashboard Editor to make changes but you can also do it via any FTP Editor.

1) Goto Appearance, click on Editor


2) You will see a list of files at the right side of the window. We’ll be editing three files namely single.php, sidebar.php and comments.php.

Note: Please make proper backups of these three files before continuing, so you can revert to original files later if you commit any error.


3) First we’ll edit single.php. Scroll down and look for “the_title();” and insert the following code before it:

<!-- google_ad_section_start -->

Then look for “the_content();” and insert the following code after it:

<!-- google_ad_section_end -->

Click on Update file.


4) Now we’ll put ‘ignore tags‘ to sidebar and comments. Goto sidebar.php and comments.php. Put the following line at beginning of code:

<!-- google_ad_section_start(weight=ignore) -->

and following line at the end of code:

<!-- google_ad_section_end -->

This completes the procedure. But It may take some time for the substantial results to appear. As it will only come into effect after the page is properly crawled by the Google bots.