Deactivating plugins in your mobile theme

The Site Compatibility Tool

The Active Plugins section in the WPtouch Pro admin panel (under Settings > Site Compatibility) generates a list of your installed and active plugins. As a first step towards deactivating a plugin in your mobile theme, deselect it in the tool. Save your settings, clear your cache, then retest. This is sufficient to deactivate the majority of plugins from within your mobile theme.

WPtouch Pro looks at the plugin’s hooks and attempts to reverse them when it loads its themes. But not all plugins hook into WordPress using best practices and some plugins force hooks in ways that prevent WPtouch Pro from being able to remove them. In other words WPtouch Pro asks nicely to remove the hooks but some plugins don’t respect that request.

Removal via a Child Theme

When attempting to disable a plugin via the Settings >  Site Compatibility > Active Plugins tool does not give the desired results, you may attempt to remove the conflicting plugin’s hooks through the child theme feature of WPtouch Pro.

  1. Open the .zip file of the plugin you wish to disable. You can download it from the free plugin repository. Or where available.
  2. Use the "Find" option on your computer to locate all the plugin’s hooks that use either add_action or add_filter.
  3. Copy those actions and filters to the functions.php file of your active WPtouch Pro child theme.
  4. Edit the hooks so they reverse the plugin’s actions and filters by changing each to remove_action and remove_filter as applicable.
For example:

When Plugins Cannot Be Disabled

Not all plugins can be disabled using the method above. These register their actions and filters in the following pattern: add_action( 'init', array( &$this, 'my_init' ) ); They will need to be disabled via the WordPress Plugins area which will also deactivate the plugin in your desktop theme. In these cases, it is recommended to find an alternative plugin that will be more compatible with both your desktop and mobile themes.
Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.

Still need help? Contact Us Contact Us