We come across an issue in wordpress site where the plugin page was not opening and all we wanted to do is activate a plugin and fix the bugs in client site.
Luckily, we had FTP access and activated the required plugin using the following plugin. It is simple, just follow the steps:
- Identify the activated theme
- If its your own site you probably know the active theme on site if not just open the chrome inspector and goto sources tab and wp-content and you will get the name of active wordpress theme.
- Open functions.php of active wordpress theme
- Paste the following code at the end of functions.php file
- You must know the plugin directory name and plugin main php file name that you want to activate.
- Simply enter the directory and php file name at the end of following code
- refresh the wp-admin and vola your desired plugin is activated via FTP.
- Good!!
function run_activate_plugin( $plugin ) { $current = get_option( 'active_plugins' ); $plugin = plugin_basename( trim( $plugin ) ); if ( !in_array( $plugin, $current ) ) { $current[] = $plugin; sort( $current ); do_action( 'activate_plugin', trim( $plugin ) ); update_option( 'active_plugins', $current ); do_action( 'activate_' . trim( $plugin ) ); do_action( 'activated_plugin', trim( $plugin) ); } return null; } run_activate_plugin( 'your-plugin-directory/your-plugin-main-file.php' );
Hope this tutorial is helpful to you, kindly share. Thanks.
Having issue? comment below or click here to contact us