WordPress the_author_link() Function

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

Definition

In WordPress, the_author_link() prints a link to the author's website. The link text is the display name.

If the author has no website, it prints only the name. It is the echo version of get_the_author_link().

Syntax

Call it with no arguments inside The Loop.

WordPress
the_author_link();
CallWhat it does
the_author_link()Prints the author link, or the plain name when there is no website.

No echo is needed. Use get_the_author_link() if you need the HTML as a string.

Full declaration
WordPress
the_author_link(): void

Parameters

ParameterDescription
NoneThis function takes no arguments. It reads the author of the current post.

Return Value

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

WordPress Examples

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

Example 1 — Basic use

Print the author link in a post.

WordPress
<?php the_author_link(); ?>

How It Works

  1. WordPress reads the website from the author profile.
  2. It prints an <a> tag with the display name.
  3. No echo is needed.

Example 2 — Byline

Use it in a simple byline.

WordPress
<p class="byline">Written by <?php the_author_link(); ?></p>

How It Works

  1. The text "Written by" is your own HTML.
  2. the_author_link() prints the link.
  3. The rest of the page stays the same.

Example 3 — Author without a website

If the profile has no website, you only see the name.

WordPress
<p class="byline">Written by <?php the_author_link(); ?></p>

How It Works

  1. "Riya Das" did not add a website.
  2. The function prints the display name only.
  3. No link is shown.

Frequently Asked Questions

It prints a link to the author website. If there is no website, it prints only the display name.
the_author_link() prints the link. get_the_author_link() returns it as a string.
No. It links to the website in the author profile. Use the_author_posts_link() for the archive.
No. It takes no arguments.
In the WordPress admin, go to Users, edit the profile, and fill the Website field.

Next: the_author_meta()

Print how many posts the current author has written.

the_author_meta() 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