An Adsense Placement Code You Can Try Out

by lovboa Banned
0 replies
  • SEO
  • |
It seems there are a lot of adsense sites that all have the same ad placements.
Usually they have it wrapped inside the first paragraph, or right under the post title.

Here's a code that you can try out that not everyone probably knows how to do. It wraps the code in the second paragraph instead of the first in every page and post.

I've been testing this ad placement out and it seems to be working great for me so far.

How to do it is...go into your Theme Functions (functions.php) and add this code:
Replace the "adsense code goes here" with your actual adsense code.
-----------------------------------------------------------------------



add_filter( 'the_content', 'my_add_after_first_p', 20 );

function my_add_after_first_p( $content ) {

$ad = '</p><div style="float:right; margin:12px;">

ADSENSE CODE GOES HERE

</div>';

$content = preg_replace( "/<\/p>/", $ad, $content, 1 );

return $content;

}


------------------------------------------------------------------------

Try it out, and I hope it increases your ctr like it did for me.
#adsense #code #placement

Trending Topics