I want to disable few wordpress plugins on my cron and an ajax page. I have already tried option_active_plugins filter but it's not working. I have checked and found most of the people say that option_active_plugins should work but it doesn't.

Here is my code:

add_filter('option_active_plugins', 'test');

function test($plugins) {
    file_put_contents(__DIR__ . '/test.txt', var_export($plugins, true));
    return $plugins;

Above code should create a file in my theme directory but this filter is not firing.

Please help!

  • 1
    Filter name is active_plugins not option_active_plugins – Sumit May 8 '16 at 7:29

Your Answer

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

Browse other questions tagged or ask your own question.