Title: Deactivate a plugin via theme functions.php
Last modified: August 21, 2016

---

# Deactivate a plugin via theme functions.php

 *  [Chirag Vora](https://wordpress.org/support/users/chirag740/)
 * (@chirag740)
 * [12 years, 9 months ago](https://wordpress.org/support/topic/deactivate-a-plugin-via-theme-functionsphp/)
 * In my WP install, I am loading different themes as per user-agent.
    I wish to
   deactivate a plugin for mobile users.
 * The path of plugin is:
    `~/public_html/wp-content/plugins/myplugin/myplugin.php`
 * Therefore I placed the following in my theme’s functions.php
    `deactivate_plugins('/
   wp-content/plugins/woocommerce-cart-tab/cart-tab.php')`
 * But it breaks the website.
    Is this the correct way to accomplish this?

The topic ‘Deactivate a plugin via theme functions.php’ is closed to new replies.

## Tags

 * [deactivate plugin](https://wordpress.org/support/topic-tag/deactivate-plugin/)
 * [mobile](https://wordpress.org/support/topic-tag/mobile/)
 * [user-agent](https://wordpress.org/support/topic-tag/user-agent/)

 * 0 replies
 * 1 participant
 * Last reply from: [Chirag Vora](https://wordpress.org/support/users/chirag740/)
 * Last activity: [12 years, 9 months ago](https://wordpress.org/support/topic/deactivate-a-plugin-via-theme-functionsphp/)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
