{"id":2361,"date":"2007-06-02T16:45:45","date_gmt":"2007-06-02T11:15:45","guid":{"rendered":"https:\/\/www.quickonlinetips.com\/archives\/2007\/06\/edit-feed-rss2php-to-customize-feeds-in-wordpress-22\/"},"modified":"2026-10-12T14:05:51","modified_gmt":"2026-10-12T08:35:51","slug":"edit-feed-rss2php-to-customize-feeds-in-wordpress-22","status":"publish","type":"post","link":"https:\/\/www.quickonlinetips.com\/archives\/2007\/06\/edit-feed-rss2php-to-customize-feeds-in-wordpress-22\/","title":{"rendered":"How to Customize WordPress RSS Feed Without Editing Core (2026)"},"content":{"rendered":"<p>Want to add a copyright line, related posts or a featured image to your feed? In 2007 we customised our WordPress feed by editing core files, first <code>wp-rss2.php<\/code> and then <code>feed-rss2.php<\/code>, and lost every change when we upgraded to WordPress 2.2. Today there&#8217;s a much better way to <strong>customize WordPress RSS feed<\/strong> output: hooks and filters that survive every update.<\/p>\n<p><img decoding=\"async\" class=\"alignnone size-full wp-image-27950\" style=\"border: 1px solid black;\" src=\"https:\/\/www.quickonlinetips.com\/archives\/wp-content\/uploads\/feed-rss2.png\" alt=\"Customize WordPress RSS feed feed-rss2.php\" width=\"337\" height=\"223\" srcset=\"https:\/\/www.quickonlinetips.com\/archives\/wp-content\/uploads\/feed-rss2.png 337w, https:\/\/www.quickonlinetips.com\/archives\/wp-content\/uploads\/feed-rss2-150x99.png 150w, https:\/\/www.quickonlinetips.com\/archives\/wp-content\/uploads\/feed-rss2-300x198.png 300w\" sizes=\"(max-width: 337px) 100vw, 337px\" \/><\/p>\n<p><strong>Quick answer:<\/strong> Don&#8217;t edit <code>wp-includes\/feed-rss2.php<\/code>; it&#8217;s overwritten on every update. Instead, add code to the Code Snippets plugin or your child theme&#8217;s functions.php using filters such as <code>the_content_feed<\/code> (add text or images to each item) and actions such as <code>rss2_item<\/code> (add custom tags). SEO plugins like Rank Math and Yoast also let you add text before or after feed content without code.<\/p>\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_90 counter-hierarchy ez-toc-counter ez-toc-custom ez-toc-container-direction\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Table of Contents<\/p>\n<label for=\"ez-toc-cssicon-toggle-item-6b04fd1ad56bd\" class=\"ez-toc-cssicon-toggle-label\"><span class=\"ez-toc-cssicon\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #1a202c;color:#1a202c\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #1a202c;color:#1a202c\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/label><input type=\"checkbox\"  id=\"ez-toc-cssicon-toggle-item-6b04fd1ad56bd\" checked aria-label=\"Toggle\" \/><nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/www.quickonlinetips.com\/archives\/2007\/06\/edit-feed-rss2php-to-customize-feeds-in-wordpress-22\/#Why_we_lost_our_feed_changes_in_2007\" >Why we lost our feed changes in 2007<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/www.quickonlinetips.com\/archives\/2007\/06\/edit-feed-rss2php-to-customize-feeds-in-wordpress-22\/#Add_content_to_every_feed_item\" >Add content to every feed item<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/www.quickonlinetips.com\/archives\/2007\/06\/edit-feed-rss2php-to-customize-feeds-in-wordpress-22\/#Add_the_featured_image_to_your_feed\" >Add the featured image to your feed<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/www.quickonlinetips.com\/archives\/2007\/06\/edit-feed-rss2php-to-customize-feeds-in-wordpress-22\/#Other_ways_to_customize_WordPress_RSS_feed_settings\" >Other ways to customize WordPress RSS feed settings<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/www.quickonlinetips.com\/archives\/2007\/06\/edit-feed-rss2php-to-customize-feeds-in-wordpress-22\/#Without_code\" >Without code<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/www.quickonlinetips.com\/archives\/2007\/06\/edit-feed-rss2php-to-customize-feeds-in-wordpress-22\/#FAQ\" >FAQ<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-7\" href=\"https:\/\/www.quickonlinetips.com\/archives\/2007\/06\/edit-feed-rss2php-to-customize-feeds-in-wordpress-22\/#Where_is_the_WordPress_RSS_feed\" >Where is the WordPress RSS feed?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-8\" href=\"https:\/\/www.quickonlinetips.com\/archives\/2007\/06\/edit-feed-rss2php-to-customize-feeds-in-wordpress-22\/#Why_dont_my_feed_changes_show_up\" >Why don&#8217;t my feed changes show up?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-9\" href=\"https:\/\/www.quickonlinetips.com\/archives\/2007\/06\/edit-feed-rss2php-to-customize-feeds-in-wordpress-22\/#Can_I_edit_feed-rss2php\" >Can I edit feed-rss2.php?<\/a><\/li><\/ul><\/li><\/ul><\/nav><\/div>\n<h2><span class=\"ez-toc-section\" id=\"Why_we_lost_our_feed_changes_in_2007\"><\/span>Why we lost our feed changes in 2007<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>Older WordPress versions built the feed from <code>wp-rss2.php<\/code> in the root folder. WordPress 2.2 moved the template to <code>wp-includes\/feed-rss2.php<\/code>, so our edits disappeared. Core files are replaced on every update, so any change there is temporary.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"Add_content_to_every_feed_item\"><\/span>Add content to every feed item<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>This snippet adds a copyright line and a link back to the post:<\/p>\n<pre><code>add_filter( 'the_content_feed', function ( $content ) {\n    $link = get_permalink();\n    $content .= '&lt;p&gt;&lt;a href=\"' . esc_url( $link ) . '\"&gt;Read the full post on our site&lt;\/a&gt;. &amp;copy; ' . date( 'Y' ) . ' ' . get_bloginfo( 'name' ) . '&lt;\/p&gt;';\n    return $content;\n} );<\/code><\/pre>\n<h2><span class=\"ez-toc-section\" id=\"Add_the_featured_image_to_your_feed\"><\/span>Add the featured image to your feed<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<pre><code>add_filter( 'the_content_feed', function ( $content ) {\n    if ( has_post_thumbnail() ) {\n        $content = get_the_post_thumbnail( null, 'large' ) . $content;\n    }\n    return $content;\n} );<\/code><\/pre>\n<h2><span class=\"ez-toc-section\" id=\"Other_ways_to_customize_WordPress_RSS_feed_settings\"><\/span>Other ways to customize WordPress RSS feed settings<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<ul>\n<li><strong>Full text or summary<\/strong>: Settings &gt; Reading &gt; &#8220;For each post in a feed, include&#8221;.<\/li>\n<li><strong>Number of items<\/strong>: Settings &gt; Reading &gt; &#8220;Syndication feeds show the most recent&#8221;.<\/li>\n<li><strong>Exclude a category<\/strong>: use the <code>pre_get_posts<\/code> action with <code>is_feed()<\/code>.<\/li>\n<li><strong>Delay publishing to feeds<\/strong> by a few minutes to fix typos first.<\/li>\n<li><strong>Custom feed template<\/strong>: copy feed-rss2.php into your child theme and load it with <code>add_feed()<\/code> if you need full control.<\/li>\n<\/ul>\n<h2><span class=\"ez-toc-section\" id=\"Without_code\"><\/span>Without code<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>Rank Math (General Settings &gt; Others) and Yoast (Settings &gt; Advanced &gt; RSS) let you add text with your post link before or after each feed item, which also helps you get credit when scrapers copy your feed. See our tips to <a href=\"https:\/\/www.quickonlinetips.com\/archives\/2013\/03\/stop-rss-feed-scraping-content-theft\/\">stop RSS feed scraping<\/a>.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"FAQ\"><\/span>FAQ<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<h3><span class=\"ez-toc-section\" id=\"Where_is_the_WordPress_RSS_feed\"><\/span>Where is the WordPress RSS feed?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>At yoursite.com\/feed\/, with category feeds at \/category\/name\/feed\/.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Why_dont_my_feed_changes_show_up\"><\/span>Why don&#8217;t my feed changes show up?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>Feed readers and caching plugins cache feeds. Clear your cache and wait for readers to refresh.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Can_I_edit_feed-rss2php\"><\/span>Can I edit feed-rss2.php?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>You can, but updates will overwrite it. Use filters or a child-theme template instead.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Want to add a copyright line, related posts or a featured image to your feed? In 2007 we customised our&#8230;<\/p>\n","protected":false},"author":4,"featured_media":27950,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_kad_post_transparent":"","_kad_post_title":"","_kad_post_layout":"","_kad_post_sidebar_id":"","_kad_post_content_style":"","_kad_post_vertical_padding":"","_kad_post_feature":"","_kad_post_feature_position":"","_kad_post_header":false,"_kad_post_footer":false,"_kad_post_classname":"","footnotes":""},"categories":[6],"tags":[17],"class_list":["post-2361","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-blogging","tag-wordpress"],"_links":{"self":[{"href":"https:\/\/www.quickonlinetips.com\/archives\/wp-json\/wp\/v2\/posts\/2361","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.quickonlinetips.com\/archives\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.quickonlinetips.com\/archives\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.quickonlinetips.com\/archives\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/www.quickonlinetips.com\/archives\/wp-json\/wp\/v2\/comments?post=2361"}],"version-history":[{"count":3,"href":"https:\/\/www.quickonlinetips.com\/archives\/wp-json\/wp\/v2\/posts\/2361\/revisions"}],"predecessor-version":[{"id":64559,"href":"https:\/\/www.quickonlinetips.com\/archives\/wp-json\/wp\/v2\/posts\/2361\/revisions\/64559"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.quickonlinetips.com\/archives\/wp-json\/wp\/v2\/media\/27950"}],"wp:attachment":[{"href":"https:\/\/www.quickonlinetips.com\/archives\/wp-json\/wp\/v2\/media?parent=2361"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.quickonlinetips.com\/archives\/wp-json\/wp\/v2\/categories?post=2361"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.quickonlinetips.com\/archives\/wp-json\/wp\/v2\/tags?post=2361"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}