How to Get the User Details of Current Logged in User in WordPress

Are you a WordPress developer or just started with WordPress, If your answer is yes, then keep bookmark this blog because you will always get the updates about WordPress and also you will get the tips & tricks of WordPress which help you a lot while you developing your next application using WordPress.

This si very short and quick tutorial, but it very useful tips of WordPress. In today tutorial, I will explain How to get the user details of current logged in user in WordPress.

WordPress Custom Post Types

How to Get the User details of Current Logged in User in WordPress

copy th below code and use in your php page or templates where you need. This will get the all the details of current logged in user from your WordPress site. Use the wp_get_current_user() this function will return the WP_User object. wp_get_current_user() function is located at wp-includes/pluggable.php file.

The output will look like:

Current Logged in User in WordPress

If you have just started with WordPress, then check out:

By using the above function you can personalise your site experience for your users. Hope this tutorial help you, Do you like & share this article with your friends, and don’t forget to follow us on Facebook and Twitter to learn cool WordPress tutorials.

If you like FreeWebMentor and you would like to contribute, you can write an article and mail your article to [email protected] Your article will appear on the FreeWebMentor main page and help other developers.

Recommended Posts:


Prem Tiwari

An engineer by profession and a passionate blogger by heart. Founder of FreeWebMentor.com (A Programming blog for beginners), Tech Speaker at various forums. A part from this he is an open source enthusiast, WordPress Lover, Blogger, SEO, and Growth Strategic.

Article Tags: , , , , , ,