benecaster_feed_channel_data
Filters the channel-level data array before the feed is rendered. Every key reaches the tag it names — the plain RSS elements and the itunes: tags are both rendered from the array this filter returns, so one change here moves every tag that carries the value. Use it to override any field at render time without touching stored settings, and — with $tier_slug — to give one tier’s feed a different title, artwork or summary from another’s.
Fires once per tier per feed compilation. The feed cache is per tier, so per-tier output is cached correctly.
| Key | Type | Renders as |
|---|---|---|
title |
string | <title>, <image><title>, <itunes:title> |
link |
string | <link>, <image><link> |
description |
string | <description> — the short show description |
summary |
string | <itunes:summary> — the full show body, tier gate already resolved |
language |
string | <language> |
copyright |
string | <copyright> — omitted when empty |
build_date |
string (RFC 2822) | <lastBuildDate> and <pubDate> |
feed_url |
string | <atom:link rel="self"> |
artwork |
string URL | <image><url> and <itunes:image href> |
author |
string | <itunes:author> and <itunes:owner><itunes:name> |
author_email |
string | <itunes:owner><itunes:email> |
subtitle |
string | <itunes:subtitle> — omitted when empty |
category |
string | <itunes:category text> — omitted when empty |
subcategory |
string | nested <itunes:category text> |
explicit |
bool | <itunes:explicit> true/false |
type |
string | <itunes:type> — episodic or serial; any other value renders episodic |
is_private |
bool | <itunes:block>Yes</itunes:block> when true |
is_complete |
bool | <itunes:complete>Yes</itunes:complete> when true |
new_feed_url |
string | <itunes:new-feed-url> — an empty string suppresses the tag |
podcast: namespace tags are not in this array — they have their own authoritative filter, benecaster_feed_podcast_channel_tags.
Suppress or override the feed redirect tag without changing stored settings
The itunes:new-feed-url redirect tag is driven by stored post meta, but sometimes you need to suppress it for a specific tier feed without touching the settings — for example, when testing migration, or when only public tier feeds should carry the redirect. This recipe clears the new_feed_url key at compile time without modifying stored meta.
When to Use This
Use benecaster_feed_channel_data when:
-
You want to suppress the redirect tag during a staging or testing workflow without clearing the stored URL
-
Your add-on needs to route different subscriber tiers to different redirect destinations
-
You’re writing a tool that gives the admin temporary control over redirect behavior without permanent changes
How It Works
Everything here runs through one key. The filter receives the channel data array and the show ID; the redirect tag is rendered from its new_feed_url entry.
-
Suppress the tag by setting
new_feed_urlto an empty string. -
Suppress conditionally — for a staging or testing workflow — by making that assignment depend on an option you control, so the redirect returns the moment you clear it.
-
Redirect somewhere else by assigning a different URL, guarding on the existing value being non-empty so you only override a redirect that was actually configured.
Notes
This only affects the current feed compilation. The stored _benecaster_show_new_feed_url post meta is untouched. If you remove this filter, the original redirect tag reappears immediately on the next feed request. To permanently remove the tag, delete the meta directly or use Settings → Show.
The new_feed_url key is always present in the channel data when a redirect is configured. If no redirect is configured, it is an empty string — there is nothing to suppress.
All other channel data keys are available. You can modify any key in the same callback — title, description, artwork, etc. See the benecaster_feed_channel_data reference for the full key list.
Related
-
Setup Wizard — Migrate from an Existing Feed — how the redirect tag is configured during setup
-
Show Settings Reference — managing the redirect after setup
<?php
// Suppress the redirect tag for the free tier only.
add_filter( 'benecaster_feed_channel_data', function ( array $data, int $show_id ): array {
// $tier_slug is available via the feed request context stored in the token.
// For a tier-agnostic override, just clear the key unconditionally.
$data['new_feed_url'] = '';
return $data;
}, 10, 2 );
Label paid feeds, or give them their own artwork, in the listener's podcast app
The artwork key moves both the plain RSS <image> and <itunes:image> — the one Apple Podcasts reads.
Apple caches show artwork aggressively; a listener may not see new artwork for days.
<?php
add_filter( 'benecaster_feed_channel_data', function ( array $data, int $show_id, string $tier_slug ): array {
if ( 'public' === $tier_slug ) {
return $data;
}
$data['title'] .= ' (Premium)'; // <title> and <itunes:title>
$data['artwork'] = 'https://cdn.example.com/premium-artwork.jpg'; // <image> and <itunes:image>
return $data;
}, 10, 3 );
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$channel_data |
array |
— | Channel data array. See the description for every key and the tag it renders. |
$show_id |
int |
— | ID of the show |
$tier_slug |
string |
— | Tier slug for this feed compilation pass (`public` for the public feed) |
Returns:
array
Examples
Label paid feeds in the podcast app
add_filter( 'benecaster_feed_channel_data', function ( array $data, int $show_id, string $tier_slug ): array {
if ( 'public' !== $tier_slug ) {
$data['title'] .= ' (Premium)';
}
return $data;
}, 10, 3 );
Suppress the redirect tag for one show without clearing stored settings
add_filter( 'benecaster_feed_channel_data', function ( array $data, int $show_id ): array {
if ( MY_SHOW_ID === $show_id ) {
$data['new_feed_url'] = '';
}
return $data;
}, 10, 2 );
Different artwork on paid feeds
add_filter( 'benecaster_feed_channel_data', function ( array $data, int $show_id, string $tier_slug ): array {
if ( 'public' !== $tier_slug ) {
// Moves both <image><url> and <itunes:image> — the one Apple Podcasts reads.
$data['artwork'] = 'https://cdn.example.com/premium-artwork.jpg';
}
return $data;
}, 10, 3 );
Notes
Always return the full array with your changes applied — a key you drop renders as empty.
$tier_slug was added 2026-09-18 as a trailing argument; a callback registered for two arguments is unaffected.
Before that date the itunes: keys (artwork, author, category, new_feed_url and the rest) did not reach
their tags, whatever this page said.
Related: benecaster_feed_episode_data (the same for each item), benecaster_rss_extra_channel_tags (add channel elements this array has no key for).
Need this built rather than just documented? See our services →