Wordpress RSS Feed description has image link

16 Views Asked by At

My RSS Feed seems to directly embed the featured image link in the description. Removing the featured image on the post will remove it, but obviously, that's not the solution.

<description><![CDATA[https://bestwithchocolate.com/wp-content/uploads/butter-chicken-028.jpg A simple weeknight meal, this butter chicken curry is delicious and flavorful.  Plus I share a recipe for simple homemade naan.  Serve with some rice on the side and you have yourself a full, delicious meal that packs a punch of flavor.]]></description>

I've tracked down the stack, but am fairly new to PHP/customizing Wordpress and am unsure where to go from here. I assume this is all boilerplate, but just in case:

//feed-rss.php
<?php
while ( have_posts() ) :
    the_post();
    ?>
    <item>
        <title><?php the_title_rss(); ?></title>
        <description><![CDATA[<?php the_excerpt_rss(); ?>]]></description>
        <link><?php the_permalink_rss(); ?></link>
        <?php
        /**
         * Fires at the end of each RSS feed item.
         *
         * @since 2.0.0
         */
        do_action( 'rss_item' );
        ?>
    </item>
<?php endwhile; ?>
//feed.php
function the_excerpt_rss() {
    $output = get_the_excerpt();
    /**
     * Filters the post excerpt for a feed.
     *
     * @since 1.2.0
     *
     * @param string $output The current post excerpt.
     */
    echo apply_filters( 'the_excerpt_rss', $output );
}
//post-template.php
function get_the_excerpt( $post = null ) {
    if ( is_bool( $post ) ) {
        _deprecated_argument( __FUNCTION__, '2.3.0' );
    }

    $post = get_post( $post );
    if ( empty( $post ) ) {
        return '';
    }

    if ( post_password_required( $post ) ) {
        return __( 'There is no excerpt because this is a protected post.' );
    }

    /**
     * Filters the retrieved post excerpt.
     *
     * @since 1.2.0
     * @since 4.5.0 Introduced the `$post` parameter.
     *
     * @param string  $post_excerpt The post excerpt.
     * @param WP_Post $post         Post object.
     */
    return apply_filters( 'get_the_excerpt', $post->post_excerpt, $post );
}

0

There are 0 best solutions below