Quick and easy.
if ( is_plugin_active( 'plugin-folder-name/main-plugin-file.php' ) )
deactivate_plugins( '/plugin-folder-name/main-plugin-file.php' );
It’s important to note the is_plugin_active
string is slightly different than the deactivate_plugins
string.
Related Posts:
- Uninstall, Activate, Deactivate a plugin: typical features & how-to
- How to automate wordpress plugin activate and deactivate by php logic?
- Plugin upgrading: Widget settings
- How to avoid plugin name conflicts from the upgrade notifier?
- Function to activate WordPress theme inside a plugin
- Activate Plugin which is in subfolder?
- Force plugin to fail activation
- WordPress register_activation_hook table creation not working
- Correct way to use register_activation_hook
- OOP: Display warning and deactivate the plugin if PHP version is less than 5.4
- Upgrade Private Plugin without Deleting
- Do you clean up your self-written plugins’ at deactivation?
- Auto add content such as pages upon plugin activation?
- Default Plugin Settings Not Writing to Database
- Plugin Deactivate Self on Activation Errors
- Why my Plugin keeps deactivating automatically?
- Prevent a plugin from being automatically activated
- Own plugin corrups plugin-activation
- Are functions in main plugin file called before function bound to register_activation_hook runs?
- Force file download on plugin activation
- Run function on plugin activation before plugin is loaded
- How to deactivate my plugin upon deactivation of NextGen
- Activation flow of a plugin in a multisite environment
- How to check for already existing plugin versions on activation? and prevent errors
- My WordPress activation hook isn’t working
- Different plugins activated online and offline
- Is it possible to run javascript on plugin deactivated?
- Does the number of downloads displayed for a plug-in in the WordPress.org plug-in directory include automatic updates?
- Why do I get this “plugin does not have a valid header” error?
- Which method is best to enqueue scripts
- WordPress Capabilities: edit_user vs edit_users
- What is the correct way to check if WP_Filesystem can write to a directory without aking for username / password?
- Is there a WordPress Plugin that allows voting “does this coupon work” on specific links like Retailmenot
- shortcode doesn’t work
- Built in admin ajax hooks?
- Could someone please help me to add category id with in this query so this will return posts from a certain category?
- Plugin not saving values when placed in a folder within /wp-content/plugins
- How to integrate plugin in WordPress theme
- building plugin and it is displaying above plugins page
- load_theme_textdomain path
- Dynamic CSS Vs Inline Issues in Code any Way around in a WordPress Themes?
- Is license need for free wordpress plugin
- How to activate plugins for my WordPress sites from a remote server
- plugin development: problem with functions
- Getting a List of Categories for Use in a Plugin?
- Building plugin with changeable custom post type values…advice needed
- How to get all of the activate_plugin action parameters?
- Display update notification messages like ‘What’s New’
- How can I make 2 plugins that include different versions of a framework to both use the latest version?
- Add Plugin options as subpage to Theme options page
- Image upload and download from front-end
- What can be reason for no plugin-strings available under stable section on translate.wordpress.org?
- WP_Terms_List_Table Quick Edit not working
- Git Hosting for WordPress SVN Plugin Repository [closed]
- Is there a directory my plugin can write files to that cannot be viewed via the browser/url?
- How to exclude certain files from the plugin editor?
- file-gallery plugin line 1573 broken in 4.2 upgrade [closed]
- Stop Plugin from Getting Styles from Other Plugin
- How do I make a secure API call from a shortcode when a button is clicked?
- WordPress REST API Plugin Development – Add Custom Endpoint
- Hook into the rendering of a WordPress Template
- Save user total active time after login in wordpress [closed]
- WordPress gtag.js with User ID tracking
- wp_loaded with static Singleton
- How to remove a CPT Menu from the Root Admin only
- Get post_id on clicking a link in WordPress
- Calling a save function from a “submit” button
- Wp Debug Enabled True Notices and Warning
- Select Form Element Not Saving from Plugin Options
- My widget won’t update its values when save is clicked
- Can we give Pending as a Role to wp_insert_user?
- How to make a Product page without ordering and database
- wp_options not returning value for logged out users?
- Gutenberg default attributes are empty when accessing in edit
- How to create admin setting for this small plugin
- Hide all Admin Notices and move on a separate page
- How to fix caching issue in PHP data from database
- Adding shortcodes to multiple pages with function
- SASS not showing in customized preloader plugin
- How to securely controlling data without keeping it in postmeta?
- Get a list of Product Categories inside a loop
- Can you develop themes and plugins while using the hosting services BlueHost? [closed]
- WordPress plugin changes not updating
- wordpress ajax pagination object value does not change
- Google analytic issue in wordpress
- Custom pages with plugin
- How to insert category name above post title in a featured pages plugin?
- Displaying friend’s posts only
- What’s the preferred method of writing AJAX-enabled plugins?
- How to add submenu to WordPress plugin in the same Directory of main Plugin?
- Shortcode registered from a plugin not recognized
- Synch Custom Post Types (and Custom Fields, Cats, etc.) Between WordPress Sites
- wp_update_post call really slow when official Facebook plugin is installed
- How to set-up multiple cron task with wp_schedule_event so that they do not overlap?
- WordPress Code Access to Restricted Content without Registration
- Plugin version number after code rewrite [closed]
- is_user_logged_in() undefined at shutdown in plugin context
- What are Seeds? [closed]
- Shortcode cannot parse attributes within double quotes. ” is becoming ” breaking my shortcode
- Plugin translations are not loaded from translate.wordpress.org