Title: get_author_feed_link
Published: April 25, 2014
Last modified: May 20, 2026

---

# get_author_feed_link( int $author_id, string $feed = '' ): string

## In this article

 * [Description](https://developer.wordpress.org/reference/functions/get_author_feed_link/?output_format=md#description)
 * [Parameters](https://developer.wordpress.org/reference/functions/get_author_feed_link/?output_format=md#parameters)
 * [Return](https://developer.wordpress.org/reference/functions/get_author_feed_link/?output_format=md#return)
 * [Source](https://developer.wordpress.org/reference/functions/get_author_feed_link/?output_format=md#source)
 * [Hooks](https://developer.wordpress.org/reference/functions/get_author_feed_link/?output_format=md#hooks)
 * [Related](https://developer.wordpress.org/reference/functions/get_author_feed_link/?output_format=md#related)
 * [Changelog](https://developer.wordpress.org/reference/functions/get_author_feed_link/?output_format=md#changelog)
 * [User Contributed Notes](https://developer.wordpress.org/reference/functions/get_author_feed_link/?output_format=md#user-contributed-notes)

[ Back to top](https://developer.wordpress.org/reference/functions/get_author_feed_link/?output_format=md#wp--skip-link--target)

Retrieves the feed link for a given author.

## 󠀁[Description](https://developer.wordpress.org/reference/functions/get_author_feed_link/?output_format=md#description)󠁿

Returns a link to the feed for all posts by a given author. A specific feed can 
be requested or left blank to get the default feed.

## 󠀁[Parameters](https://developer.wordpress.org/reference/functions/get_author_feed_link/?output_format=md#parameters)󠁿

 `$author_id`intrequired

Author ID.

`$feed`stringoptional

Feed type. Possible values include `'rss2'`, `'atom'`.
 Default is the value of 
[get_default_feed()](https://developer.wordpress.org/reference/functions/get_default_feed/).

Default:`''`

## 󠀁[Return](https://developer.wordpress.org/reference/functions/get_author_feed_link/?output_format=md#return)󠁿

 string Link to the feed for the author specified by $author_id.

## 󠀁[Source](https://developer.wordpress.org/reference/functions/get_author_feed_link/?output_format=md#source)󠁿

    ```php
    function get_author_feed_link( $author_id, $feed = '' ) {
    	$author_id           = (int) $author_id;
    	$permalink_structure = get_option( 'permalink_structure' );

    	if ( empty( $feed ) ) {
    		$feed = get_default_feed();
    	}

    	if ( ! $permalink_structure ) {
    		$link = home_url( "?feed=$feed&amp;author=" . $author_id );
    	} else {
    		$link = get_author_posts_url( $author_id );
    		if ( get_default_feed() === $feed ) {
    			$feed_link = 'feed';
    		} else {
    			$feed_link = "feed/$feed";
    		}

    		$link = trailingslashit( $link ) . user_trailingslashit( $feed_link, 'feed' );
    	}

    	/**
    	 * Filters the feed link for a given author.
    	 *
    	 * @since 1.5.1
    	 *
    	 * @param string $link The author feed link.
    	 * @param string $feed Feed type. Possible values include 'rss2', 'atom'.
    	 */
    	$link = apply_filters( 'author_feed_link', $link, $feed );

    	return $link;
    }
    ```

[View all references](https://developer.wordpress.org/reference/files/wp-includes/link-template.php/)
[View on Trac](https://core.trac.wordpress.org/browser/tags/7.0/src/wp-includes/link-template.php#L870)
[View on GitHub](https://github.com/WordPress/wordpress-develop/blob/7.0/src/wp-includes/link-template.php#L870-L902)

## 󠀁[Hooks](https://developer.wordpress.org/reference/functions/get_author_feed_link/?output_format=md#hooks)󠁿

 [apply_filters( ‘author_feed_link’, string $link, string $feed )](https://developer.wordpress.org/reference/hooks/author_feed_link/)

Filters the feed link for a given author.

## 󠀁[Related](https://developer.wordpress.org/reference/functions/get_author_feed_link/?output_format=md#related)󠁿

| Uses | Description | 
| [user_trailingslashit()](https://developer.wordpress.org/reference/functions/user_trailingslashit/)`wp-includes/link-template.php` |

Retrieves a trailing-slashed string if the site is set for adding trailing slashes.

  | 
| [get_default_feed()](https://developer.wordpress.org/reference/functions/get_default_feed/)`wp-includes/feed.php` |

Retrieves the default feed.

  | 
| [get_author_posts_url()](https://developer.wordpress.org/reference/functions/get_author_posts_url/)`wp-includes/author-template.php` |

Retrieves the URL to the author page for the user with the ID provided.

  | 
| [trailingslashit()](https://developer.wordpress.org/reference/functions/trailingslashit/)`wp-includes/formatting.php` |

Appends a trailing slash.

  | 
| [home_url()](https://developer.wordpress.org/reference/functions/home_url/)`wp-includes/link-template.php` |

Retrieves the URL for the current site where the front end is accessible.

  | 
| [apply_filters()](https://developer.wordpress.org/reference/functions/apply_filters/)`wp-includes/plugin.php` |

Calls the callback functions that have been added to a filter hook.

  | 
| [get_option()](https://developer.wordpress.org/reference/functions/get_option/)`wp-includes/option.php` |

Retrieves an option value based on an option name.

  |

[Show 4 more](https://developer.wordpress.org/reference/functions/get_author_feed_link/?output_format=md#)
[Show less](https://developer.wordpress.org/reference/functions/get_author_feed_link/?output_format=md#)

| Used by | Description | 
| [wp_list_users()](https://developer.wordpress.org/reference/functions/wp_list_users/)`wp-includes/user.php` |

Lists all the users of the site, with several options available.

  | 
| [feed_links_extra()](https://developer.wordpress.org/reference/functions/feed_links_extra/)`wp-includes/general-template.php` |

Displays the links to the extra feeds such as category feeds.

  | 
| [get_author_rss_link()](https://developer.wordpress.org/reference/functions/get_author_rss_link/)`wp-includes/deprecated.php` |

Print/Return link to author RSS feed.

  | 
| [wp_list_authors()](https://developer.wordpress.org/reference/functions/wp_list_authors/)`wp-includes/author-template.php` |

Lists all the authors of the site, with several options available.

  |

## 󠀁[Changelog](https://developer.wordpress.org/reference/functions/get_author_feed_link/?output_format=md#changelog)󠁿

| Version | Description | 
| [2.5.0](https://developer.wordpress.org/reference/since/2.5.0/) | Introduced. |

## 󠀁[User Contributed Notes](https://developer.wordpress.org/reference/functions/get_author_feed_link/?output_format=md#user-contributed-notes)󠁿

 1.  [Skip to note 2 content](https://developer.wordpress.org/reference/functions/get_author_feed_link/?output_format=md#comment-content-1512)
 2.   [Codex](https://profiles.wordpress.org/codex/)  [  10 years ago  ](https://developer.wordpress.org/reference/functions/get_author_feed_link/#comment-1512)
 3. [You must log in to vote on the helpfulness of this note](https://login.wordpress.org?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2Fget_author_feed_link%2F%23comment-1512)
    Vote results for this note: 0[You must log in to vote on the helpfulness of this note](https://login.wordpress.org?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2Fget_author_feed_link%2F%23comment-1512)
 4. **Returns the rss2 feed link for post by author 2**
 5.     ```php
        echo get_author_feed_link( '2', '' );
        ```
    
 6.  [Log in to add feedback](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2Fget_author_feed_link%2F%3Freplytocom%3D1512%23feedback-editor-1512)

You must [log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2Fget_author_feed_link%2F)
before being able to contribute a note or feedback.