Skip to main content

benecaster_ssp_import_post_data

Filter Free

Filters the wp_insert_post() argument array before each SSP draft episode is inserted. Use to override or supplement the post title, status, content, or date before the record is created. Runs for SSP posts only — a PowerPress import never fires it.

This filter covers only the WordPress post record — the post_type, post_status, post_title, post_content, post_parent, post_date, and post_date_gmt keys. All episode meta fields (audio URL, duration, artwork, and so on) are written separately after insertion and cannot be changed via this filter. To act on the newly created episode after all meta is set, use benecaster_ssp_episode_imported instead. The $ssp_post parameter provides full access to the original SSP post and its meta — read any SSP-specific field with get_post_meta( $ssp_post->ID, 'key', true ).

$post_data['post_title'] already has the setup wizard’s optional Strip this prefix from episode titles field applied by the time this filter runs — your callback sees the stripped title and still has the final say.

Customize imported episode post data during SSP import

Free Beginner

When migrating episodes from Seriously Simple Podcasting (SSP), Benecaster creates a draft episode for each imported post. This filter runs just before each draft is saved, giving you a chance to adjust the episode’s title, content, or initial status. ⚠ It fires for SSP posts only — PowerPress imports never run it.

$post_data['post_title'] arrives with the setup wizard’s own Strip this prefix from episode titles field already applied, if one was set — this callback sees the already- stripped title and still has the final say over it.

A common use: cleaning up or reformatting titles during the import — for example, prepending the show name when merging multiple shows.

<?php
add_filter( 'benecaster_ssp_import_post_data', function ( array $post_data, \WP_Post $ssp_post, int $show_id ): array {
    // Prepend show name to imported episode titles.
    $show_name            = get_the_title( $show_id );
    $post_data['post_title'] = $show_name . ': ' . $post_data['post_title'];
    return $post_data;
}, 10, 3 );

View on GitHub →

Parameters

Name Type Default Description
$post_data array wp_insert_post() data array built from the SSP post
$ssp_post \WP_Post The original SSP WP_Post being imported
$show_id int ID of the show

Returns: array

Examples

Preserve original SSP publish date

add_filter( 'benecaster_ssp_import_post_data', function( $post_data, $ssp_post, $show_id ) {
    // Preserve the original SSP publish date rather than using today's date.
    $post_data['post_date']     = $ssp_post->post_date;
    $post_data['post_date_gmt'] = $ssp_post->post_date_gmt;
    return $post_data;
}, 10, 3 );

Notes

Only the WordPress post record is available here. Episode meta (audio URL, duration, artwork, etc.) is written after insertion and cannot be set via this filter. For post-insertion work on the created episode, use benecaster_ssp_episode_imported.

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