Using WordPress ‘feed_links_extra_show_author_feed’ PHP filter

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 is true.

More information

See WordPress Developer Resources: feed_links_extra_show_author_feed

Examples

Disable the author feed link on your website.

add_filter('feed_links_extra_show_author_feed', '__return_false');

Enable the author feed link on your website.

add_filter('feed_links_extra_show_author_feed', '__return_true');

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 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 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;
});