Page 1 of 2
Word Press - Comments RSS. How do you remove the link?
Posted: Tue Feb 04, 2014 6:27 am
by simonmlewis
We have a blog where we don't allow comments or discussion - just our posts.
But we are unable to find how to remove the "Comments RSS" link, even tho our sitemap is finding it as it is there. But a dead link.
It's on the left under META. How do you remove that simple hyperlink?
Re: Word Press - Comments RSS. How do you remove the link?
Posted: Tue Feb 04, 2014 6:37 am
by Celauran
Where it is will depend on your theme, but look for
Code: Select all
<?php bloginfo('comments_rss2_url'); ?>
and remove it.
http://codex.wordpress.org/WordPress_Feeds
Re: Word Press - Comments RSS. How do you remove the link?
Posted: Tue Feb 04, 2014 6:55 am
by simonmlewis
Theme Twelve.
Where will that bloginfo be? In what file?
Re: Word Press - Comments RSS. How do you remove the link?
Posted: Tue Feb 04, 2014 7:08 am
by Celauran
The Twenty Twelve theme that comes with WP? Under Meta in the sidebar? That's a widget, and I believe part of the WP core. Probably better to remove the widget from the sidebar entirely than to start editing core files.
Re: Word Press - Comments RSS. How do you remove the link?
Posted: Tue Feb 04, 2014 7:12 am
by simonmlewis
If we do that, how do we then login and Logout?
Re: Word Press - Comments RSS. How do you remove the link?
Posted: Tue Feb 04, 2014 7:14 am
by simonmlewis
Seems strange that WP allows a "dead link" on it's site. Considering how Google and SEO loves it so much.
I also think the Entries RSS is good for Google!!
Re: Word Press - Comments RSS. How do you remove the link?
Posted: Tue Feb 04, 2014 7:42 am
by Celauran
simonmlewis wrote:If we do that, how do we then login and Logout?
/wp-admin
Re: Word Press - Comments RSS. How do you remove the link?
Posted: Tue Feb 04, 2014 7:46 am
by simonmlewis
And how will Google cache it all from the Entries RSS?
We just want that A HREF tag removed. It MUST be easy. It must be in a template somewhere?!?!?!
Re: Word Press - Comments RSS. How do you remove the link?
Posted: Tue Feb 04, 2014 8:18 am
by Celauran
Like I already said, it's a core widget. It's defined in wp-includes/default-widgets.php specifically on line 317.
Code: Select all
class WP_Widget_Meta extends WP_Widget {
function __construct() {
$widget_ops = array('classname' => 'widget_meta', 'description' => __( "Login, RSS, & WordPress.org links.") );
parent::__construct('meta', __('Meta'), $widget_ops);
}
function widget( $args, $instance ) {
extract($args);
$title = apply_filters('widget_title', empty($instance['title']) ? __('Meta') : $instance['title'], $instance, $this->id_base);
echo $before_widget;
if ( $title )
echo $before_title . $title . $after_title;
?>
<ul>
<?php wp_register(); ?>
<li><?php wp_loginout(); ?></li>
<li><a href="<?php bloginfo('rss2_url'); ?>" title="<?php echo esc_attr(__('Syndicate this site using RSS 2.0')); ?>"><?php _e('Entries <abbr title="Really Simple Syndication">RSS</abbr>'); ?></a></li>
<li><a href="<?php bloginfo('comments_rss2_url');/* Here it is! */ ?>" title="<?php echo esc_attr(__('The latest comments to all posts in RSS')); ?>"><?php _e('Comments <abbr title="Really Simple Syndication">RSS</abbr>'); ?></a></li>
<?php echo apply_filters( 'widget_meta_poweredby', sprintf( '<li><a href="%s" title="%s">%s</a></li>',
esc_url( __( 'http://wordpress.org/' ) ),
esc_attr__( 'Powered by WordPress, state-of-the-art semantic personal publishing platform.' ),
_x( 'WordPress.org', 'meta widget link text' )
) ); ?>
<?php wp_meta(); ?>
</ul>
<?php
echo $after_widget;
}
Re: Word Press - Comments RSS. How do you remove the link?
Posted: Tue Feb 04, 2014 8:33 am
by simonmlewis
Got it. Thanks.
Re: Word Press - Comments RSS. How do you remove the link?
Posted: Tue Feb 04, 2014 8:35 am
by Celauran
Bear in mind that, as this is a core file, it may be overwritten any time you update WordPress, undoing any changes you've made.
Re: Word Press - Comments RSS. How do you remove the link?
Posted: Tue Feb 04, 2014 8:37 am
by simonmlewis
Yes, I do that myself, so when that happens, I will check it.
Re: Word Press - Comments RSS. How do you remove the link?
Posted: Tue Apr 15, 2014 6:33 am
by simonmlewis
In the latest version of WordPress, theme Twenty Twelve, where is this code found to remove just the line: "Comments RSS"?
I can remove that entire blog via the RSS area in Admin, but I only want to remove that line.
I thought I found it, but I remove it but it remains!
Re: Word Press - Comments RSS. How do you remove the link?
Posted: Tue Apr 15, 2014 12:35 pm
by Celauran
It hasn't moved. It's still part of a core widget, still line 317 of wp-includes/default-widgets.php
Re: Word Press - Comments RSS. How do you remove the link?
Posted: Tue Apr 15, 2014 1:04 pm
by simonmlewis
So it is - works. Clean sitemap now.
Many thanks again.