I have a plugin where I want to intercept database changes made during the upgrade process.

It looks like the WordPress Way to do this is with the 'dbdelta_queries' filter. The trouble is, my plugin's main .php file isn't loaded during the upgrade process, so I can't hook that filter.

How can I get a plugin to hook a filter -- this filter or any filter -- during the upgrade process?

1 Answer 1


Must-use (mu) plugins are loaded during the version update process, unlike ordinary plugins. Explanation here. So it's possible to hook dbdelta_queries and the related filters from within a mu plugin.

(Thanks to Sergey Biryukov for the answer.)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.