Skip to content

WordPress notes

Fixing the get_currentuserinfo() is deprecated notice

By Hannah Voss, Editor · Reviewed September 2026 · 3 min read

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
  1. What the notice means
  2. The fix
  3. Find the code that calls it
  4. Why deprecation notices matter
  5. Questions

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

  1. Read the notice

    With WP_DEBUG on, the notice names the file and line. The path shows whether it is a plugin or your theme.

  2. Search if needed

    Search wp-content for get_currentuserinfo.

  3. Update first

    If it is a plugin, check for an update; most fixed this years ago. A plugin still calling it is probably abandoned.

  4. Patch your own code

    If it is your theme or custom plugin, apply the change above.

  5. Turn off display

    On production, log notices instead of showing them: WP_DEBUG_DISPLAY false and WP_DEBUG_LOG true.

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.

The life of a deprecated WordPress function4.5Function deprecatedNoticeShown in debugUpdatePlugin patchedLaterOld calls may fail
Notices are the early warning; failures come later.

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.

Share this guide

Hannah Voss, Editor. Checks every guide against a working WordPress install and the networks' current documentation. Last reviewed September 2026.

  1. 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
  2. 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
  3. 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