Hold back updates for one plugin
WordPress stops offering updates for the plugin you name, for example one you’ve customised or one whose next version breaks your site.
Before you switch it on: Replace example-plugin/example-plugin.php with the plugin’s folder and main file (shown in Plugins > Plugin File Editor, or run wp plugin list).
It arrives switched off, even when you install its whole pack with "Switch on after installing".
<?php
add_filter(
'site_transient_update_plugins',
static function ( $updates ) {
$hold = array( 'example-plugin/example-plugin.php' ); // Folder and main file of each plugin.
if ( is_object( $updates ) && isset( $updates->response ) && is_array( $updates->response ) ) {
foreach ( $hold as $file ) {
if ( isset( $updates->response[ $file ] ) ) {
$updates->no_update[ $file ] = $updates->response[ $file ];
unset( $updates->response[ $file ] );
}
}
}
return $updates;
}
);
Good to know
Remember to switch this off later: held-back plugins also miss security fixes.
In these packs
- Developer tools: Maintenance mode, template names, page stats, environment labels and a WP-Cron viewer.