makbol
makbol

Reputation: 310

Can't remove feed link from header

I have tried to remove via

remove_action( 'wp_head', 'feed_links', 10);

in template's functions.php but it doesn't work. I have still

<link rel="alternate" type="application/rss+xml" title="... Comments Feed" href="..." />

I'm using Wordpress 3.4.2.

Upvotes: 2

Views: 1397

Answers (1)

markratledge
markratledge

Reputation: 17561

Try

function remove_header_info() {

remove_action('wp_head', 'feed_links', 2);  //removes feeds
remove_action('wp_head', 'feed_links_extra', 3);  //removes comment feed links
}

add_action('init', 'remove_header_info');

The numbers 2 and 3 are priority; they fire earlier than 10. See https://developer.wordpress.org/reference/functions/add_action/

Upvotes: 4

Related Questions