It is always a major concern to maximize revenue from posts that have a large word count. At the same time, you also don’t want to annoy the regular readers of your blog by showing them ads on shorter articles. Read along to know how to control number of ads for different articles.
Statistics and experience show that Adsense ads yields best when placed along the body of the articles. If you study the famous Adsense heatmap, you will notice that the following two positions get the maximum exposure:
- The area under the post title.
- The area where the content of the article ends.
Showing Adsense ads both before and after the article can be annoying to the readers. Hence, a good idea would be to place a second Adsense unit on selected posts that have a word count greater than 700. You might like to place the second ad unit just at the end of the article because when the user has finished reading and he is likely to look for more resources. (see :Adsense split testing guide for WordPress and Blogger)
Here are the codes you need to use in the WordPress theme of your blog:
1. Open the functions.php file of your blog’s theme and paste the following code.
$content = ob_get_clean();
return sizeof(explode(” “, $content));
2. Now open the single.php file of your blog’s theme and find the following code
3. Place the following code right after the above code
Insert Adsense code here
The above code shows Google Adsense ads on posts that have a word count greater than 500 (change the number at your convenience).