Skip to content

How to Use get_the_author_meta in WordPress to Show Author Info

Your author’s are the heart of most WordPress sites. They write your content, engage with your audience, and generally make the site work as it should. As such, you’ll often want to get WP author meta from the site so that you can show it off in your template. The way to get meta author tag information from WordPress is a handy function called get_the_author_meta (or, if you don’t need to do any processing, the_author_meta). Using this function is a great way to get the author meta fields from your WordPress users, and show those author fields in your WordPress theme templates.

Scroll down to learn more about how to use the function get_the_author_meta and gain new insight on its nuances.

3 Common Issues to Know about get_the_author_meta and WP Author Meta

  • get_author_name was previously a way that WordPress offered to get a chosen author’s display name. Now, the best way to do that is get_the_author_meta('display_name').
  • To show (or display, echo, or print—you pick your word) your author information without otherwise processing it in PHP, you’ll want to use the_author_meta(), the WordPress function that will default to showing the selected author fields. It is functionally equivalent to calling echo get_the_author_meta.
  • get_the_author is a useful WordPress function to find the author of the current post. get_the_author_meta and get_the_author function collect the same data about the same user (when no WordPress user ID is specified). While it’s not deprecated, like get_author_name above, it’s functionally the same as get_the_author_meta('display_name').

Our Video About Using get_the_author_meta for WordPress Author Bios:

In this video, David uses the get_the_author_meta functions to fetch the description or “Biographical Info” meta field from his WordPress user—essentially get the author bio. The video doesn’t use get_the_author or get_author_name, but as we noted above, you could do those with get_the_author_meta('display_name').

Step-by-Step Guide to Showing WordPress User Meta with the_author_meta

Here, we break down the three steps to make the meta author tag visible.

  1. First, you’ll want to do this inside of WordPress template files. Generally, this will mean that you’ll be editing a file in your WordPress child theme. Here’s our Quick Guide on making a child theme.
  2. Once in that file, you’ll probably want to be inside of “The Loop”, although the get_the_author_meta functions can work either inside or outside the loop. Inside, you’ll get to show the user email with the_author_meta( 'user_email' ); outside, it would look like: the_author_meta( 'user_email', 111 ) (where 111 was this user’s $userid)/
  3. That’s all! Because it’s what we showed off in the video, the user’s flexible “Biography” field is fetched with get_the_user_meta( 'description' ) and then made to have paragraph breaks with the wpautop function. So, the final line of code was echo wpautop( get_the_user_meta( 'description' ));. (wpautop is a WordPress function which makes two line breaks into a paragraph-tag of HTML markup.)

With that, you should have a very solid understanding of how to show your WordPress author metadata and meta author bio using functions. the_author_meta and get_the_author_meta are powerful functions—it’s well worth your time to understand them in depth. Cheers!

Yay! 🎉 You made it to the end of the article!
David Hayes

0 Comments
Inline Feedbacks
View all comments

Or start the conversation in our Facebook group for WordPress professionals. Find answers, share tips, and get help from other WordPress experts. Join now (it’s free)!

0
Would love your thoughts, please comment.x

Most Searched Articles

Best JavaScript Libraries and Frameworks: Try These 14 in 2024

In this post, we look at the best JavaScript libraries and frameworks to try out this year. Why? Well, with JavaScript being available in every web browser, this makes it the most accessible programming language of ...

20 Best Free WordPress Themes for 2024 (Responsive, Mobile-Ready, Beautiful)

If you're looking for only the best free WordPress themes in the market for this year, then you're in the right place. We have more than enough such themes for you right ...

12 Best WordPress Hosting Providers of 2024 Compared and Tested

Looking for the best WordPress hosting that you can actually afford? We did the testing for you. Here are 10+ best hosts on the market ...

Handpicked Articles

How to Make a WordPress Website: Ultimate Guide for All Users – Beginners, Intermediate, Advanced

Many people wonder how to make a WordPress website. They’ve heard about WordPress, its incredible popularity, excellent features and designs, and now they want to join the pack and build a WordPress website of their own. So, where does one get ...

How to Start an Ecommerce Business: Ultimate Guide for 2024

Is this going to be the year you learn how to start an eCommerce business from scratch? You’re certainly in the right place! This guide will give you a roadmap to getting from 0 to a fully functional eCommerce business. ...