WordPress showing update available but there isn’t one [SOLVED]

Code Snippets, General

Recently I ran into an annoying situation while working on the WP Creator’s Club site. WordPress was insisting there was an update available, however, when I visited the Updates page, there were no updates showing.

Here is a screenshot of what I mean:

WordPress shows updates pending but no updates available.
Updates pending… just kidding!

In the above image you can clearly see WordPress is indicating there is an available update for something on the website, yet my updates page says everything is up to date.

How to find the update

While Googling this problem I came across an awesome PHP snippet you can drop into your functions.php file that will tell you which plugin or theme is generating this update message.

Here is the PHP snippet:

/**
 * Debug Pending Updates
 *
 * Crude debugging method that will spit out all pending plugin
 * and theme updates for admin level users when ?debug_updates is
 * added to a /wp-admin/ URL.
 */
function debug_pending_updates() {

    // Rough safety nets
    if ( ! is_user_logged_in() || ! current_user_can( 'manage_options' ) ) return;
    if ( ! isset( $_GET['debug_updates'] ) ) return;

    $output = "";

    // Check plugins
    $plugin_updates = get_site_transient( 'update_plugins' );
    if ( $plugin_updates && ! empty( $plugin_updates->response ) ) {
        foreach ( $plugin_updates->response as $plugin => $details ) {
            $output .= "<p><strong>Plugin</strong> <u>$plugin</u> is reporting an available update.</p>";
        }
    }

    // Check themes
    wp_update_themes();
    $theme_updates = get_site_transient( 'update_themes' );
    if ( $theme_updates && ! empty( $theme_updates->response ) ) {
        foreach ( $theme_updates->response as $theme => $details ) {
            $output .= "<p><strong>Theme</strong> <u>$theme</u> is reporting an available update.</p>";
        }
    }

    if ( empty( $output ) ) $output = "No pending updates found in the database.";

    wp_die( $output );
}
add_action( 'init', 'debug_pending_updates' );

How to use this code

Once you add this code block to your functions.php file and save, navigate your site’s admin dashboard and then append ?debug_updates to the end of your URL.

For example: https://example.com/wp-admin/?debug_updates

The site will then load a page showing all of the items on your site that are indicating they have an update available, even if they aren’t showing on your updates page.

It looks like this:

“I would have gotten away with it too if it weren’t for you meddling kids!”
– EDD Amazon S3 Plugin

Ah ha! Even though this plugin update isn’t showing on my updates page, I took a look at the official page for the EDD Amazon S3 plugin and saw there WAS an update available for the plugin.

I downloaded the update and then uploaded it via FTP and the issue went away.

Wrapping Up

Once you’ve installed the updates you can remove that code block from your functions.php and save it in a file for the next time you encounter one of these phantom updates on your WordPress site.

If you have a more efficient way of solving this problem or if you’ve used this and it worked, let me know about it in the comments!

As always, happy creating!

Join the Discussion

Have something to add to this or want to comment on something mentioned in the article? Hop on over to our offical Facebook page and join the discussion!

Unlimited access to all our products, use on unlimited sites.

Includes all current and future products as well as our unique 'request a plugin' feature and unlimited support.

Become a Founding Member and get

38% OFF

your membership for life.

Once the 'Founding Member' round is over, new membership will increase to the normal rate while Founding Members will lock in their membership rate. Click here to learn more.

About the Author

Alex Brinkman

Alex Brinkman

In addition to being an entrepreneur, Alex is addicted to lifestyle design, a sucker for motivational quotes and: "... just an all around great guy." - everyone When he's not busy banging on a laptop in a some obscure coffeeshop, he enjoys obstacle course races, giving random strangers compliments and automating as much of his life as possible.