开发者

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

开发者 https://www.devze.com 2023-03-18 23:31 出处:网络
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

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

精彩评论

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