Skip to content

WordPress and Atom

On my craft­ing blog I use the Tarski theme, and that used to give you the choice between Atom and RSS for the feeds. Then they took it out, say­ing that Word­Press itself gives you the choice. Well, maybe it does (or maybe it did), but nowhere in the options for 2.6.1 that I could find (maybe you need a plu­gin to do it?). Then I dis­covered that this blog’s default feed had been changed to RSS2 some time when I wasn’t look­ing, which also wasn’t what I wanted.

To jog my memory next time I upgrade Word­Press and want to use Atom by default, here’s where to change the set­ting. For­tu­nately PHP code is easy to search through! The file is feed.php in the wp-includes dir­ect­ory. Change the second para­meter in the get_default_feed func­tion to atom. Within any luck this method will even con­tinue to work in the next ver­sion. I’ll cer­tainly know to check what the default feed format is in the future.

{ 2 } Comments

  1. Peter J. | Sep 05, 2008 at 9:05 pm | Permalink

    It’s not in Word­Press as an option, but you can set your default feed type with a plu­gin, which should be easier to main­tain than edit­ing the code. Some­thing like this should work:

    <?php
    /*
    Plugin Name: Default to Atom Feed
    Description: This plugin replaces the default RSS feed with the Atom 1.0 feed.
    Version: 0.1
    */
    remove_action("do_feed_rss2", "do_feed_rss2", 10, 1);
    add_action("do_feed_rss2", "do_feed_atom", 10, 1);
    ?>

  2. David Carlton | Sep 09, 2008 at 9:54 pm | Permalink

    I was very happy when I switched to using svn to man­age my WP install­a­tion: upgrad­ing is now a single svn switch com­mand plus going to the upgrade.php web page (plus back­ing up my data­base first, just in case), and it trans­par­ently pre­serves changes like this.

Post a Comment

Your email is never published nor shared. Required fields are marked *