WordPress the_author_posts_link() Function

Beginner
4 min read
Updated: Nov 2026
3 examples
Template tag

Definition

In WordPress, the_author_posts_link() prints a link to the author archive page. The link text is the author display name.

The archive page lists all posts by that author. Use this tag inside The Loop. To get the HTML as a string, use get_the_author_posts_link().

Syntax

Call it with no arguments inside The Loop.

WordPress
the_author_posts_link();
CallWhat it does
the_author_posts_link()Prints a link to the archive of the current post author.

No echo is needed. If you want only the URL, use get_author_posts_url().

Full declaration
WordPress
the_author_posts_link( string $deprecated = '' ): void

Parameters

ParameterDescription
$deprecatedOptional. Unused. Do not pass it.

Return Value

Return ValueDescription
void (prints to the page)The function prints the link. Its twin get_the_author_posts_link() returns it.

WordPress Examples

Three short theme examples. Each one has a sample output.

Example 1 — Basic link

Print the author archive link.

WordPress
<?php the_author_posts_link(); ?>

How It Works

  1. WordPress finds the author archive URL.
  2. It prints an <a> tag with the display name.
  3. The title says "Posts by" and the name.

Example 2 — Byline

Use the link in a post byline.

WordPress
<p class="byline">
  More from <?php the_author_posts_link(); ?>
</p>

How It Works

  1. "More from" is your own text.
  2. the_author_posts_link() prints the link.
  3. Visitors click to see all posts by the author.

Example 3 — Return the link with get_

Store the link when you want to place it in a string.

WordPress
<?php
$link = get_the_author_posts_link();
echo '<p>Author: ' . $link . '</p>';
?>

How It Works

  1. get_the_author_posts_link() returns the link HTML.
  2. The string is joined to your own text.
  3. The result is printed with echo.

Frequently Asked Questions

It prints a link to the author archive page. The link text is the author display name.
the_author_posts_link() links to the author archive on your site. the_author_link() links to the website in the author profile.
Use get_author_posts_url( $author_id ).
No. It needs a current post author.
Not with this tag. Build your own link with get_author_posts_url() and your own text.

Next: wp_dropdown_users()

Print a list of all authors on your site.

wp_dropdown_users() tutorial →

About the author

Mari Selvan M P
Mari Selvan M P 🔗

Developer, cloud engineer, and technical writer

  • Experience 12 years building web and cloud systems
  • Focus Full Stack Development, AWS, and Developer Education

I write practical tutorials so students and working developers can learn by doing—from databases and APIs to deployment on AWS.

9 people found this page helpful