Skip to content

Instantly share code, notes, and snippets.

@jeherve
Created October 20, 2016 13:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jeherve/103e3f8678e9471792d3960e903acc15 to your computer and use it in GitHub Desktop.
Save jeherve/103e3f8678e9471792d3960e903acc15 to your computer and use it in GitHub Desktop.
<?php
/**
* Plugin Name: Force Deactivate Jetpack's Protect Module.
* Plugin URI: https://jetpack.com/support/security-features/#unblock
* Description: If you have lost access to your site's dashboard, you can use this plugin to deactivate the Protect module.
* Author: Automattic
* Version: 1.0.0
* Author URI: http://jetpack.com
* License: GPL2+
*
* @package Force Deactivate Protect
*/
/**
* Drop this plugin to your site's `wp-content/mu-plugins/` folder to activate it on your site,
* even if you don't have access to your dashboard.
*
* Before to use this plugin, try to unblock yourself by following the instructions here:
* https://jetpack.com/support/security-features/#unblock
*
* If you have more questions, you can contact the Jetpack team here:
* http://jetpack.com/contact-support/
*/
function jetpack_2877983_force_deactivate_protect() {
if ( class_exists( 'Jetpack' ) ) {
Jetpack::deactivate_module( 'protect' );
}
}
add_action( 'init', 'jetpack_2877983_force_deactivate_protect' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment