RSS Feed for Podcasts - WordPress Template

Published in: RSS - WordPress

You can use your WordPress blog to publish podcasts on iTunes. Most podcasters use FeedBurner to add iTunes specific author information to podcast XML feed but if you prefer to skip FeedBurner, use these feed template.

Create a new page in your WordPress dashboard and give it a custom slug (say podcast). Now create a page-podcast.php file in your WordPress themes folder and copy-paste the following code. Remember to replace information in the highlighted lines.

The permalink of that WordPress Page will become the URL of your Podcast feed which you can now publish to the iTunes Podcasting directory.

/* RSS Feed for iTunes Podcast  */
/* Source:       */

  header('Content-Type: text/xml; charset=' . get_option('blog_charset'), true);
  echo '<?xml version="1.0" encoding="'.get_option('blog_charset').'"?'.'>'; ?>

<rss xmlns:itunes="" version="2.0">
        <title><? bloginfo_rss('name'); wp_title_rss(); ?></title>
        <link><? bloginfo_rss('url') ?></link>
        <language><? bloginfo_rss('language'); ?></language>
        <description><? bloginfo_rss('description') ?></description>
            <itunes:name>Amit Agarwal</itunes:name>
        <itunes:author>Amit Agarwal</itunes:author>
        <itunes:image href="" />
        <itunes:keywords>tech, computers, tutorials</itunes:keywords>
        <itunes:subtitle>Get the most out of your tech.</itunes:subtitle>
        <itunes:summary>Podcast hosted by Amit Agarwal.</itunes:summary>
        <itunes:category text="Technology">
            <itunes:category text="Software How-To" /></itunes:category>
        <itunes:category text="Education"></itunes:category>
        <copyright>Creative Commons License</copyright>
        <? $q = new WP_Query(array('posts_per_page'=>25,'tag'=>'podcast')); ?>
        <? while( $q->have_posts()) : $q->the_post(); ?>
                <title><? the_title() ?></title>
                <link><? the_permalink() ?></link>
                    <?= mysql2date( 'D, d M Y H:i:s +0000',
                                get_post_time( 'Y-m-d H:i:s', true), false); ?>
                <guid isPermaLink="false">
                    <? the_guid(); ?>
                    <![CDATA[<? the_excerpt(); ?>]]>
                <itunes:subtitle><? the_excerpt(); ?></itunes:subtitle>
                <itunes:summary><? the_excerpt(); ?></itunes:summary>
                <itunes:author>Amit Agarwal</itunes:author>
                <itunes:keywords>computers, tech, tutorials</itunes:keywords>
                <?php rss_enclosure(); ?>
        <? endwhile; ?>
        <? wp_reset_postdata(); ?>
Published in: RSS - WordPress

Looking for something? Find here!

Meet the Author

Web Geek, Tech Columnist
Amit Agarwal

Amit Agarwal is a Google Developer Expert in GSuite and Google Apps Script. He holds an engineering degree in Computer Science (I.I.T.) and is the first professional blogger in India. Read more on Lifehacker and YourStory

Get in touch