Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
WordPress - Disable specific plugin update check
/**
* Prevent update notification for plugin
* http://www.thecreativedev.com/disable-updates-for-specific-plugin-in-wordpress/
* Place in theme functions.php or at bottom of wp-config.php
*/
function disable_plugin_updates( $value ) {
if ( isset($value) && is_object($value) ) {
if ( isset( $value->response['plugin-folder/plugin.php'] ) ) {
unset( $value->response['plugin-folder/plugin.php'] );
}
}
return $value;
}
add_filter( 'site_transient_update_plugins', 'disable_plugin_updates' );
@toddcavanaugh

This comment has been minimized.

Copy link

@toddcavanaugh toddcavanaugh commented Jun 27, 2018

Thank for sharing! Worked well. If I wanted to do this for multiple plugins, what is the best way to handle that?

@artmaug

This comment has been minimized.

Copy link

@artmaug artmaug commented Jul 4, 2018

+1

@ebetancourt

This comment has been minimized.

Copy link

@ebetancourt ebetancourt commented Aug 8, 2018

@toddcavanaugh I created a fork that will do this for multiple plugins: https://gist.github.com/ebetancourt/89b105d7334495535415799832511938

@markandcurry

This comment has been minimized.

Copy link

@markandcurry markandcurry commented Nov 3, 2018

Very helpful. Thanks!

@cliffordp

This comment has been minimized.

Copy link

@cliffordp cliffordp commented May 29, 2019

Plugin to do this for files with version control: https://github.com/cliffordp/tk-exclude-vcs-updates

@reatlat

This comment has been minimized.

Copy link

@reatlat reatlat commented Jun 12, 2019

Great!
Thank you!

@juliovedovatto

This comment has been minimized.

Copy link

@juliovedovatto juliovedovatto commented Jul 17, 2019

Great tip! Thanks dude 👍

A dev from work decided to "extend" a plugin, without telling the whole team about.

So I had to add this hook to avoid oficial plugin updates. Not the ideal approach but it will solve the problem and avoid future problems.

@amjo

This comment has been minimized.

Copy link

@amjo amjo commented Nov 13, 2019

how do we actually use this after placing it in the function.php

@reatlat

This comment has been minimized.

Copy link

@reatlat reatlat commented Nov 13, 2019

how do we actually use this after placing it in the function.php

Only hardcoded use ;)

replace plugin-folder/plugin.php to your plugin ;)

@amjo

This comment has been minimized.

Copy link

@amjo amjo commented Nov 13, 2019

how do we actually use this after placing it in the function.php

Only hardcoded use ;)

replace plugin-folder/plugin.php to your plugin ;)

Thank you so much

@reatlat

This comment has been minimized.

Copy link

@reatlat reatlat commented Nov 13, 2019

how do we actually use this after placing it in the function.php

Only hardcoded use ;)
replace plugin-folder/plugin.php to your plugin ;)

Thank you so much

take a look this fork https://gist.github.com/ebetancourt/89b105d7334495535415799832511938

This for allow you push an array of plugins to disable a bunch of them ;)

@amjo

This comment has been minimized.

Copy link

@amjo amjo commented Nov 14, 2019

how do we actually use this after placing it in the function.php

Only hardcoded use ;)
replace plugin-folder/plugin.php to your plugin ;)

Thank you so much

take a look this fork https://gist.github.com/ebetancourt/89b105d7334495535415799832511938

This for allow you push an array of plugins to disable a bunch of them ;)

To be honest, i saw this link above, and actually went ahead with that! :) this is superb!

@HarukiOgawa22899

This comment has been minimized.

Copy link

@HarukiOgawa22899 HarukiOgawa22899 commented Apr 2, 2020

Very helpful. Thanks!

@cliffordp

This comment has been minimized.

Copy link

@cliffordp cliffordp commented Apr 2, 2020

https://github.com/afragen/local-development provides this functionality

@tmcmanusCW

This comment has been minimized.

Copy link

@tmcmanusCW tmcmanusCW commented Apr 6, 2020

Works perfectly, thank you!

@jonathannz

This comment has been minimized.

Copy link

@jonathannz jonathannz commented Apr 17, 2020

Thanks very much.
Is there a relatively easy way to have some text display next to plug-ins (for which updates are disabled), indicating they are disabled?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.