Skip to content

Early-bird lifetime licence: $199 once, for the first 200 buyers only. See the offer

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.

  • Type PHP
  • Runs Everywhere (runs as WordPress loads)
  • Category Developer tools
  • Tested with WordPress 7.1

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
<?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.

Move your snippets over this afternoon.

Importing changes nothing until you switch over, and your old shortcodes keep working.