Skip to main content

benecaster_feed_podcast_channel_tags

Filter Free

Filters the channel-level Podcasting 2.0 tag array before XML output. All keys are pre-populated from show settings; use this filter to add, override, or remove entries before the feed is rendered.

Key Type Podcast 2.0 tag
guid string podcast:guid
locked {enabled: bool, owner_email: string} podcast:locked
funding {url: string, label: string} podcast:funding
block string[] podcast:block
txt list<{purpose: string, value: string}> podcast:txt
license {url: string, label: string} podcast:license
host {name: string, url: string, image: string} podcast:person role="host" — omitted when name is empty
medium string podcast:medium — one of podcast, music, video, film, audiobook, newsletter, blog, course. An empty value emits nothing
update_frequency {label: string, rrule?: string, complete?: bool} podcast:updateFrequencylabel is the node value and gates the whole tag; an rrule on its own emits nothing. complete adds complete="true"
trailers list<{title: string, url: string, pubdate: string, length?: int, type?: string, season?: int}> podcast:trailer, one element per entry. url and pubdate are both required — an entry missing either is skipped silently

trailers deserves care that the other keys do not. It is a channel-level tag carrying an episode’s media URL, which means anything you put there is published to every recipient of this feed, at whatever tier they are on. Core builds the list only from episodes the tier can already access; a filter that appends to it has no such protection, and an entry naming an episode the tier cannot reach leaks that episode’s enclosure URL to everyone.

If you are generating a channel tag that names an episode, take the tier-aware route instead of appending here — see TierAwareFeedNamespaceInterface, which hands you the list of episode IDs the current tier may see.

Pass trailer URLs through benecaster_feed_enclosure_url as core does, or a site running a download proxy will find the raw host URL republished in its channel block.

The xmlns:podcast namespace declaration is added automatically when at least one podcast: tag is present in the rendered output. All keys are optional.

Parameters

Name Type Default Description
$tags array See description for key reference.
$show_id int Show post ID

Returns: array

Example

add_filter( 'benecaster_feed_podcast_channel_tags', function( $tags, $show_id ) {
    // Add a custom <podcast:txt> verification tag for a podcast directory.
    $tags['txt'][] = [
        'purpose' => 'verify',
        'value'   => get_post_meta( $show_id, '_mypodcast_verify_token', true ),
    ];
    return $tags;
}, 10, 2 );

Need this built rather than just documented? See our services →