WordPress notes
Fixing the get_currentuserinfo() is deprecated notice
Quick answer
The notice means code on your site calls get_currentuserinfo(), which WordPress deprecated in version 4.5. Replace it with wp_get_current_user(), which returns the current user object. Find the caller from the file path in the notice or by searching your plugins and theme, and update or replace that plugin if it is not your code.
On this page
What the notice means
WordPress 4.5, released in April 2016, deprecated get_currentuserinfo(). The function still ran for a while but triggered a notice when debugging was on, and deprecated functions can be removed in later releases. The post on this domain explaining the fix was linked widely at the time because many popular plugins, including newsletter tools, showed the notice at once.
The fix
// old
global $current_user;
get_currentuserinfo();
echo $current_user->user_email;
// new
$current_user = wp_get_current_user();
echo $current_user->user_email;wp_get_current_user() returns a WP_User object. If no one is logged in, the object's ID is 0, so check is_user_logged_in() or $current_user->exists() before using the email or name.
Find the code that calls it
Read the notice
With
WP_DEBUGon, the notice names the file and line. The path shows whether it is a plugin or your theme.Search if needed
Search
wp-contentforget_currentuserinfo.Update first
If it is a plugin, check for an update; most fixed this years ago. A plugin still calling it is probably abandoned.
Patch your own code
If it is your theme or custom plugin, apply the change above.
Turn off display
On production, log notices instead of showing them:
WP_DEBUG_DISPLAYfalse andWP_DEBUG_LOGtrue.
Why deprecation notices matter
A deprecation notice is a warning that code will break in a future release. It is also a useful signal: a plugin that still triggers notices for functions deprecated years ago is not being maintained, and that is a reason to plan its replacement before it causes a real failure.
Questions
What replaces get_currentuserinfo()?
wp_get_current_user(), which returns the current WP_User object.
Is the deprecated notice dangerous?
Not by itself, but it signals code that may break in a future WordPress release.
How do I hide deprecated notices?
Keep WP_DEBUG_DISPLAY off on production and log to a file instead. Fix the cause when you can.
Hannah Voss, Editor. Checks every guide against a working WordPress install and the networks' current documentation. Last reviewed September 2026.
Related guides
- Plugin troubleshooting: what to try firstTroubleshoot a WordPress plugin problem in a safe order: caches, conflicts, debug logging, recovery mode, and disabling a plugin when the admin is down.3 min read
- External cron jobs for WordPress, the right wayReplace WP-Cron's visit-triggered schedule with a real server cron job: disable WP-Cron, call wp-cron.php or WP-CLI on a schedule, and check tasks actually run.3 min read
- Removing MashShare cleanly from a WordPress siteRemove MashShare from WordPress without breaking posts: find leftover shortcodes and theme calls, decide what to do with stored share counts, and clean options.3 min read