As far as I know, the_author_meta() automatically displays the data while get_the_author_meta() has to be echo-d, it can also be saved as variable and do something with it.

Is there something else to it that is not documented in codex?

Also, is one or the other function heavier or is there a third better alternative?

This is not the case of premature optimization - I need to dispay a lot of author data.




2 Answers 2


If you look at the source code for the_author_meta(), it simply, in essence, just echo's the result from get_the_author_meta().

WordPress has quite a lot of functions where functions with a the_* prefix simply echos the results from its get_* counter parts. The get_* prefix is almost always used for functions which return its results.

There is really no performance differences between the two functions here, and you can use anyone to your liking, although each actually has each own specific use. Use the_author_meta() if you need to display the data, it looks a bit nutty to use echo get_the_author_meta(). Use get_the_author_meta() if you need to store the data for later use, or in shortcodes which require returned content


You can always look up the source code on https://developer.wordpress.org, something you should always do. Never ever take something for granted. Just an example of the above, get_the_content() return unfiltered, raw post content, the_content returns the filtered content from the get_the_content(), so they are vastly apart in what they do


....is there a third better alternative

If you look at the source code from get_the_author_meta(), it uses get_userdata() which returns all the fields you might be interested in

  • See my updates. Feb 15, 2016 at 17:37
  • Hmm, get_userdata() seems like the best solution in cases where you need to display most of the user data (e.g profile page). Then it doesn't need to use all the other functions that seems like a waste of resources (minor waste but still) and are just used to make programmer's life easier.
    – N00b
    Feb 15, 2016 at 17:45
  • 1
    While get_the_author_meta() always uses get_userdata() and I always need to deal with more than one type of user data, I think I'll avoid get_the_author_meta() completely. That answers the question for me.
    – N00b
    Feb 15, 2016 at 17:48

With this sort of question, the simplest thing to do is to look it up in Codex then follow the link to see the function in source.

There we can see that the_author_meta just calls get_the_author_meta and passes the result through a filter.

function the_author_meta( $field = '', $user_id = false ) {
    $author_meta = get_the_author_meta( $field, $user_id );

    echo apply_filters( 'the_author_' . $field, $author_meta, $user_id );

Another important thing to note is that, like post metadata, when you request a single meta item, all of it is loaded and cached, so it doesn't really matter if you fetch one meta field or 50, it's just a single trip to the database to fetch it all in both cases.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.