WordPress filter hook · part of WordPress core

upgrader_pre_install

A WordPress core filter that 37 plugins also fire themselves, running on 9.6M+ sites between them.

“Filter the install response before the installation has started.”

How to use upgrader_pre_install

It's a filter: your callback receives the value and 1 more argument, and must return the (changed) value. Add this to your theme's functions.php or a small custom plugin:

functions.php
add_filter( 'upgrader_pre_install', function( $value, $args ) {
	// Change $value here.
	return $value;
}, 10, 2 );

Argument names come from WPForms's source. Other plugins may pass different values: check the call in the plugin you're targeting below.

This hook is fired by WordPress core too. Official reference on developer.wordpress.org →

37 plugins that fire upgrader_pre_install

Sorted by active installs. Each entry shows where the plugin calls the hook and what it passes.

  1. WPForms icon WPForms5+ million installs apply_filters( 'upgrader_pre_install', true, $args['hook_extra'] ) src/Helpers/PluginSilentUpgrader.php:449
  2. MonsterInsights icon MonsterInsights2+ million installs apply_filters( 'upgrader_pre_install', true, $args['hook_extra'] ) includes/admin/licensing/plugin-upgrader-legacy.php:446
  3. Smash Balloon Social Photo Feed icon Smash Balloon Social Photo Feed1+ million installs apply_filters( 'upgrader_pre_install', true, $args['hook_extra'] ) inc/admin/PluginSilentUpgrader.php:410
  4. WP Mail Logging icon WP Mail Logging300,000+ installs apply_filters( 'upgrader_pre_install', true, $args['hook_extra'] ) src/inc/Helpers/PluginSilentUpgrader.php:435
  5. ExactMetrics icon ExactMetrics200,000+ installs apply_filters( 'upgrader_pre_install', true, $args['hook_extra'] ) includes/admin/licensing/plugin-upgrader-legacy.php:446
  6. UserFeedback icon UserFeedback200,000+ installs apply_filters( 'upgrader_pre_install', true, $args['hook_extra'] ) includes/admin/licensing/plugin-upgrader.php:434
  7. Smash Balloon Social Post Feed icon Smash Balloon Social Post Feed100,000+ installs apply_filters( 'upgrader_pre_install', true, $args['hook_extra'] ) inc/Helpers/PluginSilentUpgrader.php:444
  8. Custom Twitter Feeds icon Custom Twitter Feeds100,000+ installs apply_filters( 'upgrader_pre_install', true, $args['hook_extra'] ) inc/Admin/PluginSilentUpgrader.php:437
  9. Feeds for YouTube (YouTube video, channel, and gallery plugin) icon Feeds for YouTube (YouTube video, channel, and gallery plugin)100,000+ installs apply_filters( 'upgrader_pre_install', true, $args['hook_extra'] ) inc/PluginSilentUpgrader.php:437
  10. ProfilePress icon ProfilePress100,000+ installs apply_filters( 'upgrader_pre_install', true, $args['hook_extra'] ) src/Classes/Installer/PluginSilentUpgrader.php:439
  11. Reviews Feed icon Reviews Feed100,000+ installs apply_filters( 'upgrader_pre_install', true, $args['hook_extra'] ) class/Common/Helpers/PluginSilentUpgrader.php:446
  12. LoginWP (Formerly Peter’s Login Redirect) icon LoginWP (Formerly Peter’s Login Redirect)80,000+ installs apply_filters( 'upgrader_pre_install', true, $args['hook_extra'] ) src/core/src/Admin/Installer/PluginSilentUpgrader.php:439
  13. kk Star Ratings icon kk Star Ratings70,000+ installs apply_filters( 'upgrader_pre_install', true, $args['hook_extra'] ) lib/Installer/KKStar_PluginSilentUpgrader.php:433
  14. Feeds for TikTok (TikTok feed, video, and gallery plugin) icon Feeds for TikTok (TikTok feed, video, and gallery plugin)70,000+ installs apply_filters( 'upgrader_pre_install', true, $args['hook_extra'] ) inc/Common/Helpers/PluginSilentUpgrader.php:451
  15. Easy Digital Downloads icon Easy Digital Downloads40,000+ installs apply_filters( 'upgrader_pre_install', true, $args['hook_extra'] ) src/Admin/Installers/PluginSilentUpgrader.php:439
  16. Popup Box icon Popup Box40,000+ installs apply_filters( 'upgrader_pre_install', true, $args['hook_extra'] ) includes/admin/class-ays-pb-upgrader.php:435
  17. Secure Copy Content Protection and Content Locking icon Secure Copy Content Protection and Content Locking20,000+ installs apply_filters( 'upgrader_pre_install', true, $args['hook_extra'] ) includes/admin/class-secure-copy-content-protection-upgrader.php:435
  18. Uncanny Toolkit for LearnDash icon Uncanny Toolkit for LearnDash20,000+ installs apply_filters( 'upgrader_pre_install', true, $args['hook_extra'] ) src/uncanny-one-click-installer/includes/PluginSilentUpgrader.php:428
  19. Quiz Maker by AYS icon Quiz Maker by AYS20,000+ installs apply_filters( 'upgrader_pre_install', true, $args['hook_extra'] ) includes/admin/class-quiz-maker-upgrader.php:435
  20. Change Mail Sender icon Change Mail Sender20,000+ installs apply_filters( 'upgrader_pre_install', true, $args['hook_extra'] ) src/Helpers/PluginSilentUpgrader.php:431
  21. FunnelKit Automations icon FunnelKit Automations20,000+ installs apply_filters( 'upgrader_pre_install', true, $args['hook_extra'] ) includes/plugin_helpers/class-bwfan-plugin-silent-upgrader.php:432
  22. MailOptin icon MailOptin10,000+ installs apply_filters( 'upgrader_pre_install', true, $args['hook_extra'] ) src/core/src/Admin/Installer/PluginSilentUpgrader.php:439
  23. PushEngage icon PushEngage8,000+ installs apply_filters( 'upgrader_pre_install', true, $args['hook_extra'] ) app/Utils/PluginUpgraderSilent.php:460
  24. Registrations for the Events Calendar icon Registrations for the Events Calendar7,000+ installs apply_filters( 'upgrader_pre_install', true, $args['hook_extra'] ) includes/helpers/PluginSilentUpgrader.php:439
  25. Poll Maker by AYS icon Poll Maker by AYS6,000+ installs apply_filters( 'upgrader_pre_install', true, $args['hook_extra'] ) includes/admin/class-poll-maker-upgrader.php:435
  26. Chartify icon Chartify3,000+ installs apply_filters( 'upgrader_pre_install', true, $args['hook_extra'] ) includes/admin/class-chart-builder-upgrader.php:435
  27. Admin Bar & Dashboard Access Control icon Admin Bar & Dashboard Access Control3,000+ installs apply_filters( 'upgrader_pre_install', true, $args['hook_extra'] ) fuse/Installer/PluginSilentUpgrader.php:433
  28. Photo Gallery by Ays icon Photo Gallery by Ays1,000+ installs apply_filters( 'upgrader_pre_install', true, $args['hook_extra'] ) includes/admin/class-gallery-photo-gallery-upgrader.php:435
  29. Pie Register icon Pie Register1,000+ installs apply_filters( 'upgrader_pre_install', true, $args['hook_extra'] ) classes/admin/PieRegPluginSilentUpgrader.php:422
  30. AI ChatBot with ChatGPT and Content Generator by AYS icon AI ChatBot with ChatGPT and Content Generator by AYS300+ installs apply_filters( 'upgrader_pre_install', true, $args['hook_extra'] ) includes/admin/class-chatgpt-assistant-upgrader.php:435
  31. Advanced Related Posts icon Advanced Related Posts300+ installs apply_filters( 'upgrader_pre_install', true, $args['hook_extra'] ) includes/admin/class-advanced-related-posts-upgrader.php:435
  32. Easy Form icon Easy Form100+ installs apply_filters( 'upgrader_pre_install', true, $args['hook_extra'] ) includes/admin/class-ays-form-maker-upgrader.php:441
  33. RewardsWP icon RewardsWP100+ installs apply_filters( 'upgrader_pre_install', true, $args['hook_extra'] ) src/Pluggable/PluginSilentUpgrader.php:447
  34. FAQ Builder AYS icon FAQ Builder AYS100+ installs apply_filters( 'upgrader_pre_install', true, $args['hook_extra'] ) includes/admin/class-faq-builder-upgrader.php:435
  35. Pie Forms icon Pie Forms80+ installs apply_filters( 'upgrader_pre_install', true, $args['hook_extra'] ) includes/core/helper/plugin-silent-upgrader.php:418
  36. Personal Dictionary icon Personal Dictionary70+ installs apply_filters( 'upgrader_pre_install', true, $args['hook_extra'] ) includes/admin/class-personal-dictionary-upgrader.php:435
  37. Fox LMS icon Fox LMS60+ installs apply_filters( 'upgrader_pre_install', true, $args['hook_extra'] ) includes/admin/class-fox-lms-upgrader.php:435

Need a customisation built on this hook?

Tell us what you want to change and which plugin it's for. We'll write it, test it and send it back as a small plugin.