Prefix WordPress Custom Post Titles For RSS

Is it possible to prefix a custom post wordpress title so that it appears on an RSS feed and other sharing mediums?

For example:

Read More

Custom post type = products
Title = A new tea cup

Output = Product – A new tea cup

Related posts

Leave a Reply

1 comment

  1. Try filtering the_title_rss and prepending the custom post type if its not post:

    function rss_cpt_title($title) {
        global $post;
        $post_type = get_post_type($post->ID);
        if ($post_type != 'post'){
            $title = $post_type . ' - ' . $title;
        }
        return $title;
    }
    add_filter('the_title_rss', 'rss_cpt_title');
    

    You might need to fiddle with the conditional, as get_post_type might return a slug, and it might be case sensitive.