On the register_activation_hook()
function of the new plugin use the function deactivate_plugins()
(or deactivate_plugin_before_upgrade()
) and deactivate the older plugin and also delete the data with delete_option
. If you will also delete the files, then use the function uninstall_plugin($plugin)
; maybe delete_plugins( $plugins, $redirect="" )
Related Posts:
- Uninstall, Activate, Deactivate a plugin: typical features & how-to
- How to delete custom taxonomy terms in plugin’s uninstall.php?
- Does plugin uninstall always put WordPress back into original state?
- WordPress plugin installation error
- What is $tab in `install_plugins_{$tab}` hook?
- How to check what plugins used to be on a WordPress installation?
- UnInstallation of a Plugin from a developers perspective – The correct and clean method
- uninstall.php file in Plugin to clean DB
- get 404 when accessing wp-admin/plugin-install.php
- How to delete custom taxonomy terms in plugin’s uninstall.php?
- Redirect to another page using contact form 7? [closed]
- Remove .htaccess portion upon plugin deactivation?
- plugin uninstall function drop the tables, but shows errors on admin
- Does WordPress check for updates of a plugin via plugins root folder name?
- Is it possible/advisable to set last stable version to previous version?
- Hook into install email
- Get plugin directory from a theme
- Rewriting every url
- category_name not working (not showing up in sql query debug)
- What happens when two plugins have the same 3rd party class included into them?
- add_rewrite_rule, plugin activation and plugin deactivation
- Custom admin column disappearing when using Quick Edit [duplicate]
- Create page when plugin is activated
- Allowing Custom Capability to Manage Plugin Options
- wp_insert_user – how to send verification email before logging in
- Custom plugin settings: clicking “save changes” does not display success message
- How to un-attach rich text editor from named textarea elements
- Make plugin uninstalable on older versions of WordPress
- How can I translate the name of my Plugin for other languages?
- how to not show plugin in admin area
- Memory Leak in plugin action
- Getting User email on logout. wp_logout
- How can I filter blog name?
- Logs to check when the plugin was first installed for the first time
- Can a plugin add to header/footer/body content?
- Detect if a plugin was included in a certain page
- How Can A Plugin Hook Itself To the End of Every Excerpt?
- Allow Facebook to preview posts before published
- Admin page: form with enctype=”multipart/form-data” does not transfer its data
- Getting a 404 when trying to load /wp-admin/plugin-install.php
- add action for displaying posts using a shortcode
- Best way to hook a custom url?
- How do I add a custom sub menu menu under Woo-commerce marketing?
- How to load plugin after page is loaded – pagespeed issues
- One of my plugins broke when I tried to update it, how do I safely uninstall it?
- Theme and plugin install or update display error in localhost
- How to create custom tables in WordPress using my own plugin?
- How to modify WCMP Rest API response?
- Making a Template for a CPT created by a plugin
- Woocommerce dependent plugin
- External CSS in WordPress Plugin [closed]
- User Session and Stored Cookies not get removed
- Create a navbar filter that filters by a custom field
- Woocommerce Minimum Price for a Composite Product to add in cart
- add tabs in rdp-plugin/includes/settings.php and get settings saved
- Plugin Development Form Self Submission
- How To Extend A WordPress Plugin Without Losing Your Changes [duplicate]
- Does a blank plugin come with any overhead?
- Admin AJAX doesn’t work in plugin admin page – Even though code is copied verbatim from WordPress Codex
- WPDB: Update table
- Why is my custom post type not being activated on plug-in activation?
- Check filter defined or not?
- A server-side hook failed when committing plugin code to SVN
- Content-Security-Policy Headers are there and showing the correct settings, but still getting a refused connection
- SMTP Error: Could not authenticate [closed]
- Development of plugins to add components like JqueryUI
- plugin enqueue style on all pages
- How to delete all categories programatically?
- Adding submenu to custom plugin menu page created with add_menu_page() function
- What is necessary to secure a WP plugin against direct file access attempts?
- why the wp_register_script doesn’t work for register_activation_hook
- Add a Custom Field in Comment Box next to the Text area
- How do you create a re-useable HTML fragment in wordpress
- Set Button in PluginDocumentSettingPanel Content (WordPress Gutenberg)
- GitHub plugins safe to use in my website?
- woocommerce: Customize email with item total count
- The styles in the recent posts widgets plugin not working
- Link custom post type to page
- implement checkbox or toggle switch in plugin code
- wordpress form not saving or updating
- How to put a maximum real-time users limit
- Custom admin plugin read CSV
- How can I call functions from a custom plugin?
- How to get short description under heading – Visual Composer [closed]
- plugin installing error
- WordPress Plugin Install / Update Problem
- Plugin install error: Installation failed: The package could not be installed
- Why the output of an image gallery plugin is not displayed into a page of my custom theme?
- How can I use wp_ajax_response for front-end error reporting?
- Force download a file within plugin file
- How can I use multi Media Uploader in a plugin?
- Is it possible to run javascript on plugin deactivated?
- Gutenberg: Dynamic Block – Show saved data in the editor
- How to fix ‘Call to undefined function do_settings()’ error?
- How do I set register_meta for a specific CPT?
- How to Enfroce Domain Licensing Limits? [closed]
- How can I save the selected page in the dropdown after anyone clicks on Save Changes?
- Update Content for a Custom Block Toolbar Button
- Submitting form to admin-post.php WordPress
- WordPress Throwing Deprecated Errors on its own Files