AI Verified

Name

Disable plugin updates

About

Some plugins just need to stay to that version. This snippet ensures that no automatic or manual update can be performed my anyone.

Language

PHP

Rating

Voted: 1 by 1 user(s)

How to Setup Snippet

Add your plugin relative path to $pluginsToDisable array in order to block it from any update. The example will block WP Bakery and Advanced Custom Fields.

Codevault

tinny

Scroll down to see more snippets from this codevault.

Wordpress Compatability

The author has indicated that this snippet is compatable up to wordpress version: 6.1

Our AI bot has checked this snippet is compatable up to wordpress version: 6.1

Code Snippet Plugin Sync

Free & Pro

Download this snippet by clicking the download button, then head over to the Code Snippet Plugin settings in your wordpress admin dashboard, select the import menu then upload this file to import into your wordpress site.

Pro Only (Coming Soon)

You will be able to click a button and sync this snippet to your wordpress site automatically and from your dashboard manage all code snippets across all your wordpress sites that have the Code Snippets Pro plugin installed.

History

Last modified:

23/11/2022

Important Note

This snippet has the following status:

AI Verified

This snippet has been tested by our AI bot, see any comments below.

AI Bot Comments:

Found 0 vulnerabilities

Disable plugin updates

 
                    
1function disable_plugin_updates( $value ) {
2$pluginsToDisable = [
3 'js_composer/js_composer.php' , //Wp Bakery
4 'advanced-custom-fields-pro/acf.php' //Advanced custom fields
5 ];
6 
7 if ( isset($value) && is_object($value) ) {
8 foreach ($pluginsToDisable as $plugin) {
9 if ( isset( $value->response[$plugin] ) ) {
10 unset( $value->response[$plugin] );
11 }
12 }
13 }
14 return $value;
15}
16add_filter( 'site_transient_update_plugins', 'disable_plugin_updates' );

1

Related Snippets

Please see some snippets below related to this snippet..

WordPress Admin

AI Verified

0

Remove The Events Calendar menu item from the WordPress Admin Bar

Added: 5 months ago

Last Updated: 5 months ago

This snippets removes the "Events" link from the WordPress admin bar. The link comes from The Events Calendar plugin.

WordPress Admin

AI Verified

1

Disable Wordpress Admin Bar Test

Added: 1 year ago

Last Updated: 1 month ago

There must be many of these - this is just my test I also want to see if line breaks are preserved in the description   should be free

WordPress Admin

AI Verified

1

Add custom post types to the At a Glance Dashboard widget

Added: 5 months ago

Last Updated: 4 months ago

This snippet adds your custom post types to the "At a Glance" widget on your WordPress Dashboard. By default, only Posts and Pages display, but this snippet will allow you to pull in counters for all...

Other Snippets in this Codevault

These are some popular snippets from this users codevault..

WordPress Admin

AI Verified

1

Hide Login Errors

Added: 1 year ago

Last Updated: 1 year ago

Hide login error making them more generic to avoid giving any hint to potential harmful attacks

WordPress Admin

AI Verified

1

Disable plugin updates

Added: 1 year ago

Last Updated: 1 year ago

Some plugins just need to stay to that version. This snippet ensures that no automatic or manual update can be performed my anyone.

General

AI Verified

1

Disable author pages

Added: 1 year ago

Last Updated: 1 year ago

This snippet will disable the auto-generated author pages