开发者

How to stop wp_head() to not print XML feed URLs?

I do not want my wp blog to print RSS/Atom Feed urls in html. One way to do it is to comment following lines in wp-includes/default-filters.php

add_action( 'wp_head',             'feed_links',                    2     );
add_action( 'wp_head',             'feed_links_extra',              3     );

But problem here is that if I upldate WP using da开发者_Go百科shboard I may loose these changes. Is there a way to stop WP printing these Feed URLs?


It is not a solution anyway, never change core files.

Use this code in your in wp-content/themes/{your theme}/functions.php

remove_action( 'wp_head', 'feed_links_extra', 3 ); // Removes the links to the extra feeds such as category feeds

remove_action( 'wp_head', 'feed_links', 2 ); // Removes links to the general feeds: Post and Comment Feed
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜