Something like this should work.
function wpse45941_disable_feed( $comments ) {
if( $comments ) {
wp_die( 'No feed available' );
}
}
add_action('do_feed', 'wpse45941_disable_feed',1 );
add_action('do_feed_rdf', 'wpse45941_disable_feed',1 );
add_action('do_feed_rss', 'wpse45941_disable_feed',1 );
add_action('do_feed_rss2', 'wpse45941_disable_feed',1 );
add_action('do_feed_atom', 'wpse45941_disable_feed',1 );
Note: I haven’t tested that at all, I just wrote it right into the answer box.
Related Posts:
- Where to remove from comment’s feed?
- Comments feed – Undefined named entity: ndash
- How to Define Custom Number of Items in Comment Feed
- How to resolve 404 errors for wordpress comments/feed when I have disabled comments
- Add option to disable comments on a per posts basis?
- Paginate result set from $wpdb->get_results()
- Change Comment Author Display Name
- What should I do to make generated avatars different for anonymous comments?
- Check If comment author is registered
- How do I turn off wordpress comments ability to capture a users ip address?
- Success message in comment form
- How to allow the reply link to remain on the comment form after I have reached my 10 nested comment limit?
- Threaded comments – deleting parent comment leads to orphan comments
- Is there a hook for comment author link?
- How can I edit the email sent when a new comment is received?
- How to remove or replace the log-in link for comment replies?
- Change the HTML output of comments
- Twitter/Facebook login for comments [closed]
- Customize reply form different to comment form
- Add delete, approve, spam Links to Comments
- FB – Comment Moderation Tool bug or error in the code?
- If new comment posted in custom post – send notification to custom email from custom field
- Disable Admin account being emailed for comment notification
- WP_Comment_Query with 5 top level comments per page?
- Can I have two single.php files and have one display just the post and the other display comments for that specific post?
- How can I change the link in comment form “Log in to post a comment”?
- remove_filter( ‘comment_author’, ‘floated_admin_avatar’ ); doesn’t work
- What is the correct/safe way to delete all comments?
- Does wp_new_comment expect a comment in HTML?
- Draft / schedule comments?
- How to insert Comment metadata via REST API
- How to create a link to jump to “Leave a comment” part?
- Opening all posts for comments
- Unix timestamp for post comment
- Ajax comments not working
- Check if someone recently commented in one of my posts
- How to query comments only for the current post?
- Redirect to page 2 after comment
- WordPress Comments are automatically publishing
- save_post action hook for comments
- Automatically increase comment karma on comment save
- How to create a seperate commenting system?
- How to handle upvotes and downvotes of disqus comments after importing disqus comments to wordpress?
- Only admin can see comments on post or page
- All users/comments suspected as bot? [closed]
- Show comments of a user post only when they are login
- comments in Admin
- How to get and use the the number of days since the last comment?
- Get all child comments ids from parent comment id
- How do I add class to an admin comment?
- Best way to tell if a comment is from a user?
- Adding SQL source code to comments
- How to control size of comments popup window?
- How to make comments private for commentor and post author
- Name of comment field differs on different sites
- WordPress Spam Comment Filter
- Which hook do I use to edit pending comment count on wordpress dashboard?
- Add comment_id on Comments page within wp-admin
- comment button shows only logged in users wordpress
- Getting comments of an specefic user
- How can I embed comments plugin to my own website?
- get only one last comment from each post
- Applying same style to all the comments on the page
- Customise Comment form
- Limit action in comment according to IP
- How to get recent comment link
- stumped on add_action hook to delete_comment – any ideas?
- Can I create a new comment type?
- Avoiding calls to theme-compat
- Allow tags between shortcode in comments
- How to load new posts from wordpress db into wordpress homepage without refreshing the site?
- Delete/Spam Comment Button
- Who approved a comment, to show up in dashboard
- comments.php remove date/time’s #hyperlink
- comment just attachment .. reply just text … can I do that?
- I have an odd field with a purple background, mentioning HTML-codes to use while leaving comments
- No comment Section but still got a Comment
- How to prevent users/authors from seing IP/email of new commentators?
- Why are my threaded comments not quite working? [closed]
- $post->comment_status always returns ‘closed’
- Order comments in admin by custom date
- WordPress Comments – Divide by conversation like Medium.com
- edit comments in front end
- How to replace anonymous comment form with a registration form on wordpress?
- How to get the 5 most recent comments and each comment 5 most recent replies (children)
- Redirect first time comments
- Posting XML in comment section
- How to check if post has previous_comments_link() and next_comments_link()
- comment files and s
- Comments – Ensure the correct field is highlighted for nested replies
- How to hold all comments for moderation, including author’s comments on own post
- Recent comments per tagged post?
- Subscribe to a post’s comments without posting a comment yourself
- WordPress error when sending comment
- WordPress Page Template: Comment Filtering with Querystring
- comments are going to spam
- Why default comment fields don’t show up?
- How to enable truly anonymous posting in bbPress forums? [closed]
- TinyMCE in comment reply form showing toolbar but can’t edit reply
- Add pending for reply comment in console WordPress