Categorized | General, Make Money

Inserting ads in RSS feeds.

Posted on 13 June 2009 by Raman

Inserting ads in RSS feeds.

Inserting Ads in your blog’ RSS feed can be a good idea to boost up your earnings. You may have seen many peoples doing this.

If you publish your feeds with FeedBurner (now acquired by Google) then you can easily show Adsense ads there at by using Adsens for feeds.

And if you want to show other ads in your RSS feeds, then you can do this by modifying the functions.php file (if you dont have one create it).

<?php
function insertAds($content) {
$content = $content.’<hr /><a href=”http://webmasters-blog.com/”>Keep visiting webmasters-blog.com</a><hr />’;
return $content;
}
add_filter(’the_excerpt_rss’, ‘insertAds’);
add_filter(’the_content_rss’, ‘insertAds’);
?>

Here, we first create a function called insertAds(), which concatenate a code containing our advertisment to the $content variable, which contains the content of the post.
Then, we use the add_filter() function to overwrite the the_content_rss() function with our insertAds() function. We use another filter to overwrite the_excerpt_rss() function as well.
That’s all, your rss feeds now displays your ads!

If you enjoyed this post, make sure you subscribe to my RSS feed!

Related posts

1 Comments For This Post

  1. Instant PayPal Affiliate Commissions Directory Says:

    Thanks for PHP code. I heard that Google bought Feedburner but your code tips are spot on. Kudos on the helpful blog post.

1 Trackbacks For This Post

  1. Total number of sites as on May 2009. « Webmaster Tips Says:

    [...] Inserting ads in RSS feeds. (0) [...]

Leave a Reply

Affiliate Theme Advertise Here
Advertise Here