Title: get_plugin_updates
Published: April 25, 2014
Last modified: August 20, 2026

---

# get_plugin_updates(): array<string,

## In this article

 * [Return](https://developer.wordpress.org/reference/functions/get_plugin_updates/?output_format=md#return)
 * [Source](https://developer.wordpress.org/reference/functions/get_plugin_updates/?output_format=md#source)
 * [Related](https://developer.wordpress.org/reference/functions/get_plugin_updates/?output_format=md#related)
 * [Changelog](https://developer.wordpress.org/reference/functions/get_plugin_updates/?output_format=md#changelog)

[ Back to top](https://developer.wordpress.org/reference/functions/get_plugin_updates/?output_format=md#wp--skip-link--target)

Retrieves plugins with updates available.

## 󠀁[Return](https://developer.wordpress.org/reference/functions/get_plugin_updates/?output_format=md#return)󠁿

 array<string, object> Array of plugin objects with available updates.

## 󠀁[Source](https://developer.wordpress.org/reference/functions/get_plugin_updates/?output_format=md#source)󠁿

    ```php
    function get_plugin_updates() {
    	$all_plugins     = get_plugins();
    	$upgrade_plugins = array();
    	$current         = get_site_transient( 'update_plugins' );

    	foreach ( (array) $all_plugins as $plugin_file => $plugin_data ) {
    		if ( isset( $current->response[ $plugin_file ] ) ) {
    			$upgrade_plugins[ $plugin_file ]         = (object) $plugin_data;
    			$upgrade_plugins[ $plugin_file ]->update = $current->response[ $plugin_file ];
    		}
    	}

    	return $upgrade_plugins;
    }
    ```

[View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/update.php/)
[View on Trac](https://core.trac.wordpress.org/browser/tags/7.1/src/wp-admin/includes/update.php#L404)
[View on GitHub](https://github.com/WordPress/wordpress-develop/blob/7.1/src/wp-admin/includes/update.php#L404-L417)

## 󠀁[Related](https://developer.wordpress.org/reference/functions/get_plugin_updates/?output_format=md#related)󠁿

| Uses | Description | 
| [get_plugins()](https://developer.wordpress.org/reference/functions/get_plugins/)`wp-admin/includes/plugin.php` |

Checks the plugins directory and retrieve all plugin files with plugin data.

  | 
| [get_site_transient()](https://developer.wordpress.org/reference/functions/get_site_transient/)`wp-includes/option.php` |

Retrieves the value of a site transient.

  |

| Used by | Description | 
| [WP_Debug_Data::get_wp_plugins_raw_data()](https://developer.wordpress.org/reference/classes/wp_debug_data/get_wp_plugins_raw_data/)`wp-admin/includes/class-wp-debug-data.php` |

Gets the raw plugin data for the WordPress active and inactive sections of the debug data.

  | 
| [WP_Site_Health::get_test_plugin_version()](https://developer.wordpress.org/reference/classes/wp_site_health/get_test_plugin_version/)`wp-admin/includes/class-wp-site-health.php` |

Tests if plugins are outdated, or unnecessary.

  | 
| [WP_Automatic_Updater::send_email()](https://developer.wordpress.org/reference/classes/wp_automatic_updater/send_email/)`wp-admin/includes/class-wp-automatic-updater.php` |

Sends an email upon the completion or failure of a background core update.

  | 
| [list_plugin_updates()](https://developer.wordpress.org/reference/functions/list_plugin_updates/)`wp-admin/update-core.php` |

Display the upgrade plugins form.

  |

## 󠀁[Changelog](https://developer.wordpress.org/reference/functions/get_plugin_updates/?output_format=md#changelog)󠁿

| Version | Description | 
| [2.9.0](https://developer.wordpress.org/reference/since/2.9.0/) | Introduced. |

## User Contributed Notes

You must [log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2Fget_plugin_updates%2F)
before being able to contribute a note or feedback.