WordPress the_author_meta() Function

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

Definition

In WordPress, the_author_meta() prints one profile field of an author. For example, the display name, the bio, or the first name.

Pass the field name. Inside The Loop it uses the current post author. Outside The Loop, pass a user ID as the second value. To get the value as a string, use get_the_author_meta().

Syntax

Give the field name. Add a user ID if you are not inside The Loop.

WordPress
the_author_meta( $field );
the_author_meta( $field, $user_id );
CallWhat it does
the_author_meta( 'description' )Prints the bio of the current post author.
the_author_meta( 'first_name', 1 )Prints the first name of the user with ID 1.

Use get_the_author_meta() when you need the value instead of printing it.

Full declaration
WordPress
the_author_meta( string $field = '', int|false $user_id = false ): void

Parameters

ParameterDescription
$fieldRequired in practice. The profile field name, for example display_name.
$user_idOptional. The user ID. Leave it out to use the current post author.

Common field names

FieldWhat it holds
display_nameThe public name.
first_name, last_nameFirst and last name.
nicknameThe nickname from the profile.
descriptionThe bio.
user_urlThe website.
user_emailThe email address. Do not show it publicly.
IDThe user ID number.

Return Value

Return ValueDescription
void (prints to the page)The function prints the field value. Its twin get_the_author_meta() returns it.

WordPress Examples

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

Example 1 — Display name

Print the display name with the field name.

WordPress
<p>By <?php the_author_meta( 'display_name' ); ?></p>

How It Works

  1. The field name is display_name.
  2. No user ID is passed, so the current post author is used.
  3. The value is printed in place.

Example 2 — Author bio

Show the bio below a post.

WordPress
<div class="author-box">
  <h3><?php the_author_meta( 'display_name' ); ?></h3>
  <p><?php the_author_meta( 'description' ); ?></p>
</div>

How It Works

  1. description is the Biographical Info field in the profile.
  2. Each call prints one value.
  3. Wrap them in your own HTML for styling.

Example 3 — Author archive title

On author.php there is no current post, so pass the user ID.

WordPress
<h1>
  Posts by
  <?php the_author_meta( 'display_name', get_queried_object_id() ); ?>
</h1>

How It Works

  1. get_queried_object_id() returns the author ID on an author archive.
  2. The ID is the second value.
  3. The display name of that user is printed.

Frequently Asked Questions

It prints one profile field of an author, such as display_name or description.
the_author_meta() prints the field. get_the_author_meta() returns it so you can store or escape it.
Use the_author_meta( 'description' ).
Pass the user ID: the_author_meta( 'display_name', get_queried_object_id() ).
Avoid it on public pages. Showing email addresses can lead to spam.
Yes. Pass the meta key name as the field, if your plugin or theme stored a custom field on the user.

Next: the_author_posts()

Print a link to the author archive page.

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