TGM Plugin Activation

The best way to require and recommend plugins for WordPress themes (and other plugins).

How do I remove TGMPA from my theme/plugin ?

If your theme or plugin no longer needs TGM Plugin Activation (TGMPA) support, then these are the steps you need to take to remove TGMPA. Some initiative may be needed depending on how the theme or plugin author has added it in, and it is assumed you are comfortable editing PHP files / FTP as needed.

  1. Find and delete the plugin registration function. It will look something like:
     * Required and Recommended Plugins
    function prefix_register_plugins() {
    	 * Array of plugin arrays. Required keys are name and slug.
    	 * If the source is NOT from the .org repo, then source is also required.
    	$plugins = array(
    		// WordPress SEO
    			'name'     => 'WordPress SEO by Yoast',
    			'slug'     => 'wordpress-seo',
    			'required' => false,
    	tgmpa( $plugins );
    add_action( 'tgmpa_register', 'prefix_register_plugins' );
    There should only be one instance of tgmpa( or tgmpa_register in your theme or plugin (other than the TGMPA class file), so search for that. The registration function may be with other code in functions.php, init.php or a separate file such as include/tgmpa.php or other file.
  2. Find and delete the require_once() call that references the TGMPA class file:
     * Include the TGM_Plugin_Activation class.
    require_once dirname( __FILE__ ) . '/class-tgm-plugin-activation.php';
    The file name is almost certainly unique, so search your theme or plugin for that. The theme or plugin author may have used require, include or include_once instead of require_once, and they may have added extra ( ) around the file path.
  3. Find and delete the TGMPA class file. Since the class file is no longer referenced, the whole class-tgm-plugin-activation.php file (or equivalent if renamed) can be deleted from your theme or plugin.

With the plugins registration, the class file reference, and the class file itself all removed, your theme or plugin will no longer be using TGMPA.

FAQ Index