0

Looking to the apache log of my host I found tons of requests that look like https://www.mywebsite.com/post-name/7239/feed/

Why having /feed in a post? It sounds weird and the content seems not so useful as well.

<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
    xmlns:content="http://purl.org/rss/1.0/modules/content/"
    xmlns:dc="http://purl.org/dc/elements/1.1/"
    xmlns:atom="http://www.w3.org/2005/Atom"
    xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
    
    >
<channel>
    <title>
    Commenti a: BNL Business Way: Numero Verde, Contatti e Costi    </title>
    <atom:link href="https://www.superinformati.com/bnl-business/7239/feed/" rel="self" type="application/rss+xml" />
    <link>https://www.superinformati.com/bnl-business/7239/</link>
    <description>Il vostro blog di informazione e curiosità</description>
    <lastBuildDate>Sat, 15 Oct 2022 10:13:29 +0000</lastBuildDate>
    <sy:updatePeriod>
    hourly  </sy:updatePeriod>
    <sy:updateFrequency>
    1   </sy:updateFrequency>
    <generator>https://wordpress.org/?v=6.0.3</generator>
</channel>
</rss>

Can I remove it? Is it a standard wordpress feature?

1 Answer 1

4

Yes, it's a core feature in WordPress, and /post-name/feed/ is a post-specific comment feed and is one of the built-in feeds in WordPress — see https://wordpress.org/support/article/wordpress-feeds/ which says:

Comments

Your site has feeds for all comments on the site, and each post has its own comment feed.

Site comment feed:

  • http://example.com/comments/feed/ (permalink format)
  • http://example.com/?feed=comments-rss2 (default/plain format)

Post-specific comment feed:

  • http://example.com/post-name/feed/ (permalink format)
  • http://example.com/?p=123&feed=rss2 (default/plain format, where the 123 is the post ID)

You can disable all feeds, if you want to, but people would no longer be able to get updates like recent posts and comments from your site via feeds or feed readers..

But for completeness, here's an example which works with the post-specific comment feed, where this code sets the HTTP status to 404 when accessing a comment feed:

add_action( 'do_feed_rdf', 'my_disable_feeds', 9 );
add_action( 'do_feed_rss', 'my_disable_feeds', 9 );
add_action( 'do_feed_rss2', 'my_disable_feeds', 9 ); // RSS2 is the default feed format
add_action( 'do_feed_atom', 'my_disable_feeds', 9 );

function my_disable_feeds( $is_comment_feed ) {
    if ( $is_comment_feed && is_singular() ) {
        status_header( 404 );
        exit;
    }
}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.