Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Option to disable only the comments feed #57

Closed
GermanKiwi opened this issue Jun 26, 2013 · 11 comments
Closed

Option to disable only the comments feed #57

GermanKiwi opened this issue Jun 26, 2013 · 11 comments

Comments

@GermanKiwi
Copy link

Hi, on the Titles & Metas > General page, there's an option to "Hide RSS Links".

Could you kindly expand this setting to allow us to chose which RSS link specifically to hide?

I mean this: WordPress includes two RSS feeds - the main feed and the comments feed. I would like to be able to hide only the comments feed, but not the main feed. This is because I have disabled comments completely on my website - I don't need or want comments - but the (empty) comments feed link still exists in the 'head' section anyway, and therefore appears in the address bar of some browsers like Firefox etc.

So it would be great if this plugin would allow me to only disable that one feed but not the main feed. :)

Thanks!

@jrfnl
Copy link
Contributor

jrfnl commented Jul 12, 2013

Hi Jeremy,

FYI: I just had a quick look at this - thinking it could be a quick fix to add -, but it's not actually that easy to implement - if at all possible -.

Notes for developers (in case it would be decided to implement this):

The main feed and the comments feed are echo'd out in one go by the feed_links() function in the wp-includes/general_template.php file. This function does not offer a way to filter the output, so it's either have both links or none at all (by removing the function from the wp_head actions queue - which is what the plugin currently does if the option to do so is turned on -).

The only way I can currently think of to do this, would be to copy the WP-core function into the plugin and add a conditional display option for the comments link there, remove the WP feed_links action and add an action to the copied function.

This however would create kind of a maintenance nightmare - quite apart from it being bad practice - as you'd have to keep an eye on any changes made to the WP-core function and be sure to emulate these into the function copied into the plugin.

A better route might be to submit a patch to WP core which adds an output filter to the feed_links() function. However getting these kind of patches accepted & merged is often a slow process, so no telling when the filter would be available.

Ok, that's my two pennies... ;-)

Smile,
Juliette

@GermanKiwi
Copy link
Author

From what I've since read and learned, it's not possible to disable the comments feed without also disabling the main feed as well. It's either both or none.

So I've solved this for myself by disabling both feeds (using the appropriate 'remove_action' in my functions.php), and then manually adding back just the main feed via another function in my functions.php file. This does the trick for me and I think it's the only solution currently available.

I'll close this ticket as this request is obviously beyond the scope of this plugin.

@jdevalk
Copy link
Contributor

jdevalk commented Aug 22, 2013

Well, it's not possible right now, but I do want to make it possible, so I'm reopening.

@jdevalk jdevalk reopened this Aug 22, 2013
@GermanKiwi
Copy link
Author

Well, okay - thanks! :)

@fastmover
Copy link

This would be a great feature.

@jdevalk
Copy link
Contributor

jdevalk commented Aug 8, 2014

Just submitted a patch to core to make this possible. Find it here: https://core.trac.wordpress.org/ticket/23692

@GermanKiwi
Copy link
Author

Nice! Thanks for doing so!

@tacoverdo
Copy link
Member

Current status of core-patch that would make this possible:
has-patch

@Rarst
Copy link
Contributor

Rarst commented Sep 14, 2015

Core patch merged for 4.4. I wonder though how to implement this specific to a version of core. Do we just silently hide setting when running on earlier versions?

@Rarst Rarst self-assigned this Sep 14, 2015
seripap pushed a commit to seripap/wordpress-seo that referenced this issue Nov 19, 2015
@Rarst
Copy link
Contributor

Rarst commented Apr 27, 2016

The removal of header links feature has been dropped from the plugin.

See #3599

@Rarst Rarst closed this as completed Apr 27, 2016
hansjovis pushed a commit that referenced this issue Nov 21, 2022
hansjovis pushed a commit that referenced this issue Nov 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants
@jdevalk @fastmover @jrfnl @Rarst @GermanKiwi @tacoverdo and others