6 FeedBurner tweaks to spruce up your WordPress feed delivery

FeedBurner is by the primary mode of RSS feed delivery for websites and blogs. htpcBeginner is no different and our posts are delivered right to your Inbox or Reader through FeedBurner. In this post, let us look at a few FeedBurner tweaks to spruce up your feed delivery and also make the best out of your RSS feeds. Recently, we showed you how to get FeedBurner subscriber count using PHP, which you can then display as simple text or record to a database. This post will focus on a different aspect but in general will require you to edit your website or blog's configuration files. You may also need access to your .htaccess file for some of the FeedBurner tweaks. Without further delay, let us start tweaking your RSS feed delivery through FeedBurner.

Feedburner Tweaks

Accessing your Default WordPress Feeds

WordPress provides feeds as rss, rss2, rdf, or atom. You may access these feeds using the links below:

http://domain.com/?feed=rss
http://domain.com/?feed=rss2
http://domain.com/?feed=rdf
http://domain.com/?feed=atom

If WordPress permalinks is enabled, you can access your feeds using the links below:

http://domain.com/feed/
http://domain.com/feed/rss/
http://domain.com/feed/rss2/
http://domain.com/feed/rdf/
http://domain.com/feed/atom/

Now that we know how to access the WordPress feeds let us start implementing the FeedBurner tweaks.

FeedBurner Tweaks

If you have not setup FeedBurner for your blog, head over to FeedBurner's Website to set it up.

1. Redirect WordPress Feed to FeedBurner

The first thing you want to do after setting up feed burner is to automatically redirect all WordPress feed links listed above to FeedBurner. To accomplish you will have to edit your .htaccess file that is present in the root directory of your blog. Edit it and add the following lines to the top (important) of it:

<ifmodule mod_rewrite.c>
RewriteEngine on
RewriteCond %{HTTP_USER_AGENT} !FeedBurner [NC]
RewriteCond %{HTTP_USER_AGENT} !FeedValidator [NC]
RewriteRule ^feed/?([_0-9a-z-] )?/?$ http://feeds.feedburner.com/htpcBeginner [R=302,NC,L]
</ifmodule>

Note that Apache's redirect module needs to be enabled. Also, do not forget to change http://feeds.feedburner.com/htpcBeginner to your FeedBurner feed link. Restart your Apache web server, and all your feed links should now go to FeedBurner automatically. If you are hosting with a service provider then you will have to save the .htaccess file and wait for the changes to be applied.

2. Add Featured Image to RSS Feeds

This is one of favorite FeedBurner tweaks. FeedBurner content by itself looks dull. You can spruce it up by adding a featured image, which may also attract more visitors. In order to achieve this, you will have to edit functions.php located in your theme folder (/wp-content/themes/themename). Add the following code block to it.

/** Image in RSS feed */
function featuredtoRSS($content) {
global $post;
if ( has_post_thumbnail( $post->ID ) ){
$content = '' . get_the_post_thumbnail( $post->ID, 'thumbnail', array( 'style' => 'float:left; margin:0 15px 15px 0;' ) ) . '' . $content;
}
return $content;
}
add_filter('the_excerpt_rss', 'featuredtoRSS');
add_filter('the_content_feed', 'featuredtoRSS');

This should now take the set featured image of each post and add it as featured image to its RSS feed content.

Feedbuner Tweaks
Feedburner Feed Featured Image

3. Exclude Categories

If you do not want posts in certain categories to be delivered through RSS feed you can exclude. In such case your WordPress feed link would look something like this:

http://www.domain.com/?cat=-123&feed=rss2

The cat=-123 part excludes category id 123 from being included in the feed. You may then use this feed link to setup your FeedBurner feed. If your FeedBurner is already setup then you may edit the source feed and provide the new feed from above. If you prefer not to mess with FeedBurner you may simply add the following code to your functions.php to achieve the same result.

/** Exclude Category in RSS Feeds */
function myFeedExcluder($query) {
 if ($query->is_feed) {
   $query->set('cat','-123,-124');
 }
return $query;
}
add_filter('pre_get_posts','myFeedExcluder');

WordPress will not filter out category ids 123 and 124 from the feed output.

4. Category, Tag, or Comment Feeds

To show feed for a specific category use one of the following links depending on whether your have permalink enabled (former) or not (latter):

http://domain.com/category/categoryname/feed
http://www.domain.com/?cat=42&feed=rss2

This will show feed for the category id 42. Similarly, for specific tags use one of the following links depending on whether your have permalink enabled (former) or not (latter):

http://domain.com/tag/tagname/feed
http://www.domain.com/?tag=tagname&feed=rss2

Replace tagname with the tag for which you want the feed. Finally, for comment feeds use one of the following links depending on whether your have permalink enabled (former) or not (latter):

http://domain.com/comments/feed/
http://domain.com/?feed=comments-rss2

You may then use any of the above feed links setup specific FeedBurner feeds. Check out the WordPress documentation to know more about WordPress Feeds.

5. Add a Favicon for the Feed

Having a favicon creates an identity and makes it easy for your readers to find your feed. This FeedBurner Tweak adds a favicon to your FeedBurner feed as shown in the Google Reader screenshot below:

Feedburner Tweaks
Feedburner Feed Favicon

To achieve this, all you have to do is place your favicon (favicon.ico) in the root folder of your blog.

6. Protect your Feed

One of the most important FeedBurner tweaks you should implement is protecting your feed content from RSS scrappers that steal and autopost your content on their sites. There are several WordPress plugins available to address this. If you are using Yoast's WordPress SEO plugin, you can go to SEO->RSS and add this following code for "Content to put after each post:".

%%POSTLINK%% is a post from %%BLOGLINK%%

HTML is allowed and you may format the above line as you wish. The result is a line like the one below will be automatically added below each feed content. While this does not stop scrappers form scrapping your content at least you have a backlink pointing back to your site.

Feedburner Tweaks
Rss Feed Footer

You can get a bit more creative here by adding affiliate links to generate some income as well (as shown in the example below). With Google killing Adsense for feeds, this could be one way you can generate much needed revenue. However, abusing this may drive readers away.

Feedburner Tweaks
Rss Feed Affiliate Links

Finishing Touches

Now that we we have implemented the FeedBurner tweaks, you may be wondering why the changes have not appeared yet on your feed. FeedBurner feeds take about an hour to update feed cache. If you cannot wait you may go to the troubleshooting page for your feed, scroll down, and click on the "Resync Now" button to clear cache and update your feed content.

Feedburner Tweaks
Feedburner Resync

Now visiting your FeedBurner feed page should show all the FeedBurner tweaks you implemented. If you implemented the above FeedBurner tweaks, your feed should look something like this:

Feedburner Tweaks
Tweaked Feedburner Feed

Go ahead, implement the FeedBurner tweaks and spruce up your feed delivery.

Be the 1 in 200,000. Help us sustain what we do.
111 / 150 by Dec 31, 2024
Join Us (starting from just $1.67/month)

Anand

Anand is a self-learned computer enthusiast, hopeless tinkerer (if it ain't broke, fix it), a part-time blogger, and a Scientist during the day. He has been blogging since 2010 on Linux, Ubuntu, Home/Media/File Servers, Smart Home Automation, and related HOW-TOs.

Try Deployarr