The feed_links_extra_show_author_feed WordPress PHP filter allows you to control the display of the author feed link on your website.
Usage
add_filter('feed_links_extra_show_author_feed', function($show) { // your custom code here return $show; });
Parameters
$show
(bool) – Whether to display the author feed link. Default istrue
.
More information
See WordPress Developer Resources: feed_links_extra_show_author_feed
Examples
Disable author feed link
Disable the author feed link on your website.
add_filter('feed_links_extra_show_author_feed', '__return_false');
Enable author feed link
Enable the author feed link on your website.
add_filter('feed_links_extra_show_author_feed', '__return_true');
Disable author feed link for specific user roles
Disable the author feed link for users with the ‘subscriber’ role.
add_filter('feed_links_extra_show_author_feed', function($show) { if (current_user_can('subscriber')) { return false; } return $show; });
Disable author feed link based on author ID
Disable the author feed link for a specific author with an ID of 3.
add_filter('feed_links_extra_show_author_feed', function($show) { $author_id = get_the_author_meta('ID'); if ($author_id == 3) { return false; } return $show; });
Disable author feed link on specific pages
Disable the author feed link on pages with the ‘about’ or ‘contact’ slug.
add_filter('feed_links_extra_show_author_feed', function($show) { global $post; if ($post && ($post->post_name == 'about' || $post->post_name == 'contact')) { return false; } return $show; });