Title: get_the_author_meta
Published: April 25, 2014
Last modified: August 20, 2026

---

# get_the_author_meta( string $field = '', int|false $user_id = false ): string

## In this article

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

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

Retrieves the requested data of the author of the current post.

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

Valid values for the `$field` parameter include:

 * admin_color
 * comment_shortcuts
 * description
 * display_name
 * first_name
 * ID
 * last_name
 * nickname
 * plugins_last_view
 * plugins_per_page
 * rich_editing
 * syntax_highlighting
 * user_activation_key
 * user_description
 * user_email
 * user_firstname
 * user_lastname
 * user_level
 * user_login
 * user_nicename
 * user_pass
 * user_registered
 * user_status
 * user_url

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

 `$field`stringoptional

The user field to retrieve.

Default:`''`

`$user_id`int|falseoptional

User ID. Defaults to the current post author.

Default:`false`

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

 string The author’s field from the current author’s DB object, otherwise an empty
string.

## 󠀁[More Information](https://developer.wordpress.org/reference/functions/get_the_author_meta/?output_format=md#more-information)󠁿

If used within [The Loop](https://codex.wordpress.org/The_Loop), the user ID need
not be specified, it defaults to current post author. A user ID must be specified
if used outside [The Loop](https://codex.wordpress.org/The_Loop).

[get_the_author_meta()](https://developer.wordpress.org/reference/functions/get_the_author_meta/)
returns the data for use programmatically in PHP. To just display it instead, use
[the_author_meta()](https://developer.wordpress.org/reference/functions/the_author_meta/)

If the specified meta field does not exist for this user, an empty string is returned.

Plugins may add additional fields to the user profile, which in turn adds new key/
value pairs to the wp_usermeta database table. This additional data can be retrieved
by passing the field’s key to the function as the `$field` parameter.

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

    ```php
    function get_the_author_meta( $field = '', $user_id = false ) {
    	$original_user_id = $user_id;

    	if ( ! $user_id ) {
    		global $authordata;
    		$user_id = $authordata->ID ?? 0;
    	} else {
    		$authordata = get_userdata( $user_id );
    	}

    	if ( in_array( $field, array( 'login', 'pass', 'nicename', 'email', 'url', 'registered', 'activation_key', 'status' ), true ) ) {
    		$field = 'user_' . $field;
    	}

    	$value = $authordata->$field ?? '';

    	/**
    	 * Filters the value of the requested user metadata.
    	 *
    	 * The filter name is dynamic and depends on the $field parameter of the function.
    	 *
    	 * @since 2.8.0
    	 * @since 4.3.0 The `$original_user_id` parameter was added.
    	 *
    	 * @param string    $value            The value of the metadata.
    	 * @param int       $user_id          The user ID for the value.
    	 * @param int|false $original_user_id The original user ID, as passed to the function.
    	 */
    	return apply_filters( "get_the_author_{$field}", $value, $user_id, $original_user_id );
    }
    ```

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

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

 [apply_filters( “get_the_author_{$field}”, string $value, int $user_id, int|false $original_user_id )](https://developer.wordpress.org/reference/hooks/get_the_author_field/)

Filters the value of the requested user metadata.

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

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

Retrieves user info by user ID.

  | 
| [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.

  |

| Used by | Description | 
| [WP_Posts_List_Table::column_author()](https://developer.wordpress.org/reference/classes/wp_posts_list_table/column_author/)`wp-admin/includes/class-wp-posts-list-table.php` |

Handles the post author column output.

  | 
| [WP_Media_List_Table::column_author()](https://developer.wordpress.org/reference/classes/wp_media_list_table/column_author/)`wp-admin/includes/class-wp-media-list-table.php` |

Handles the author column output.

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

Retrieves the description for an author, post type, or term archive.

  | 
| [export_wp()](https://developer.wordpress.org/reference/functions/export_wp/)`wp-admin/includes/export.php` |

Generates the WXR export file for download.

  | 
| [wp_prepare_revisions_for_js()](https://developer.wordpress.org/reference/functions/wp_prepare_revisions_for_js/)`wp-admin/includes/revision.php` |

Prepare revisions for JavaScript.

  | 
| [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_profile()](https://developer.wordpress.org/reference/functions/get_profile/)`wp-includes/deprecated.php` |

Retrieve user data based on field.

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

Retrieve the ICQ number of the author of the current post.

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

Retrieve the Yahoo! IM name of the author of the current post.

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

Retrieve the MSN address of the author of the current post.

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

Retrieve the AIM address of the author of the current post.

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

Retrieve the specified author’s preferred display name.

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

Retrieve the URL to the home page of the author of the current post.

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

Retrieve the ID of the author of the current post.

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

Retrieve the description of the author of the current post.

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

Retrieve the login name of the author of the current post.

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

Retrieve the first name of the author of the current post.

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

Retrieve the last name of the author of the current post.

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

Retrieve the nickname of the author of the current post.

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

Retrieve the email of the author of the current post.

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

Retrieves formatted date timestamp of a revision (linked to that revisions’s page).

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

Outputs the field from the user’s DB object. Defaults to current post’s author.

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

Retrieves either author’s link or author’s name.

  |

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

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

| Version | Description | 
| [6.9.0](https://developer.wordpress.org/reference/since/6.9.0/) | Removed `aim`, `jabber`, and `yim` as valid values for the `$field` parameter. | 
| [2.8.0](https://developer.wordpress.org/reference/since/2.8.0/) | Introduced. |

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

 1.   [Skip to note 8 content](https://developer.wordpress.org/reference/functions/get_the_author_meta/?output_format=md#comment-content-3500)
 2.    [aThemeArt](https://profiles.wordpress.org/athemeart/)  [  7 years ago  ](https://developer.wordpress.org/reference/functions/get_the_author_meta/#comment-3500)
 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_the_author_meta%2F%23comment-3500)
     Vote results for this note: 9[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_the_author_meta%2F%23comment-3500)
 4.  Get the author ID Outside loop:
 5.      ```php
         global $post;
         $author_id = $post->post_author;
         ```
     
 6.  Get the author ID inside a loop :
 7.      ```php
          $author_id = get_the_author_meta( 'ID' ); 
         ```
     
 8.  bellow is a few examples of author value :
 9.      ```php
         // to get  nicename
         get_the_author_meta( 'nicename', $author_id );
     
         // to get  email
         get_the_author_meta( 'email', $author_id );
     
         // to get  url
         get_the_author_meta( 'url', $author_id );
     
         // to get  status
         get_the_author_meta( 'status', $author_id );
         ```
     
 10.  [Log in to add feedback](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2Fget_the_author_meta%2F%3Freplytocom%3D3500%23feedback-editor-3500)
 11.  [Skip to note 9 content](https://developer.wordpress.org/reference/functions/get_the_author_meta/?output_format=md#comment-content-1559)
 12.   [studio-jt](https://profiles.wordpress.org/studiojt/)  [  11 years ago  ](https://developer.wordpress.org/reference/functions/get_the_author_meta/#comment-1559)
 13. [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_the_author_meta%2F%23comment-1559)
     Vote results for this note: 7[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_the_author_meta%2F%23comment-1559)
 14. **Display the author bio (description) keeping the line break**
 15.     ```php
         <?php echo nl2br(get_the_author_meta('description')); ?>
         ```
     
 16.  [Log in to add feedback](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2Fget_the_author_meta%2F%3Freplytocom%3D1559%23feedback-editor-1559)
 17.  [Skip to note 10 content](https://developer.wordpress.org/reference/functions/get_the_author_meta/?output_format=md#comment-content-2187)
 18.   [Milana Cap](https://profiles.wordpress.org/milana_cap/)  [  9 years ago  ](https://developer.wordpress.org/reference/functions/get_the_author_meta/#comment-2187)
 19. [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_the_author_meta%2F%23comment-2187)
     Vote results for this note: 4[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_the_author_meta%2F%23comment-2187)
 20. Using the [wpautop()](https://developer.wordpress.org/reference/functions/wpautop/)
     for description will also keep the line break (like in [studio-jt’ comment](https://developer.wordpress.org/reference/functions/get_the_author_meta/?output_format=md#comment-1559))
     but will output cleaner html:
 21.     ```php
         /**
          * Display Author's description 
          * with keeping line breaks and wrapping its paragraphs
          * into <p> tag
          *
          * @link https://developer.wordpress.org/reference/functions/wpautop/
          */
         echo wpautop( get_the_author_meta( 'description' ) );
         ```
     
 22.  [Log in to add feedback](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2Fget_the_author_meta%2F%3Freplytocom%3D2187%23feedback-editor-2187)
 23.  [Skip to note 11 content](https://developer.wordpress.org/reference/functions/get_the_author_meta/?output_format=md#comment-content-3246)
 24.   [Salim](https://profiles.wordpress.org/salimhossain/)  [  7 years ago  ](https://developer.wordpress.org/reference/functions/get_the_author_meta/#comment-3246)
 25. [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_the_author_meta%2F%23comment-3246)
     Vote results for this note: 2[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_the_author_meta%2F%23comment-3246)
 26. Get the author ID:
 27.     ```php
         <?php $user_id = get_the_author_meta( 'ID' ); ?>
         ```
     
 28.  [Log in to add feedback](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2Fget_the_author_meta%2F%3Freplytocom%3D3246%23feedback-editor-3246)
 29.  [Skip to note 12 content](https://developer.wordpress.org/reference/functions/get_the_author_meta/?output_format=md#comment-content-484)
 30.   [Codex](https://profiles.wordpress.org/codex/)  [  11 years ago  ](https://developer.wordpress.org/reference/functions/get_the_author_meta/#comment-484)
 31. [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_the_author_meta%2F%23comment-484)
     Vote results for this note: 1[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_the_author_meta%2F%23comment-484)
 32. **Show a User’s Display Name With Email Address Linked**
      Get the email address
     for user ID 25, and echo it using their display name as the anchor text.
 33.     ```php
         <p>Email the author: 
             <a href="mailto:<?php echo get_the_author_meta( 'user_email', 25 ); ?>">
                 <?php the_author_meta( 'display_name', 25 ); ?>
             </a>
         </p>
         ```
     
 34.  [Log in to add feedback](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2Fget_the_author_meta%2F%3Freplytocom%3D484%23feedback-editor-484)
 35.  [Skip to note 13 content](https://developer.wordpress.org/reference/functions/get_the_author_meta/?output_format=md#comment-content-483)
 36.   [Codex](https://profiles.wordpress.org/codex/)  [  11 years ago  ](https://developer.wordpress.org/reference/functions/get_the_author_meta/#comment-483)
 37. [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_the_author_meta%2F%23comment-483)
     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_the_author_meta%2F%23comment-483)
 38. **Get A User’s Email Address**
      Get the email address for the author of the current
     post and store it in the `$user_email` variable for further use. (Remember, this
     function returns data, it doesn’t display it.)
 39.     ```php
         <?php $user_email = get_the_author_meta( 'user_email' ); ?>
         ```
     
 40.  [Log in to add feedback](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2Fget_the_author_meta%2F%3Freplytocom%3D483%23feedback-editor-483)
 41.  [Skip to note 14 content](https://developer.wordpress.org/reference/functions/get_the_author_meta/?output_format=md#comment-content-2350)
 42.   [karlazz](https://profiles.wordpress.org/karlazz/)  [  9 years ago  ](https://developer.wordpress.org/reference/functions/get_the_author_meta/#comment-2350)
 43. [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_the_author_meta%2F%23comment-2350)
     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_the_author_meta%2F%23comment-2350)
 44. What are the author meta that I can use in “field”?
 45. Could they be added to this page? Or a link to another page that lists them could
     be added perhaps?
 46.  * Just confirmed that it will get any user meta fields, including other ones 
        created with `add_user_meta()`
      * [Bruno Cantuaria](https://profiles.wordpress.org/cantuaria/) [8 years ago](https://developer.wordpress.org/reference/functions/get_the_author_meta/#comment-3116)
 47.  [Log in to add feedback](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2Fget_the_author_meta%2F%3Freplytocom%3D2350%23feedback-editor-2350)

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