You can deactivate it with:
deactivate_plugins( basename( __FILE__ ) );
I don’t think you can delete it. It would be a big security risk, IMO. But if the folder has the correct (but insecure) permissions, you could use the PHP function rmdir
Related Posts:
- Best collection of code for your 'functions.php' file [closed]
- Should all plugins be encapsulated in a Class?
- How can I edit post data before it is saved?
- How can I delete orphan keys in WordPress database tables?
- Is it a good idea to edit an already existing plugin to add more functionality?
- OpenID for WordPress 3.x? [duplicate]
- Get a button for in the Editor
- Plugin (or Theme) containing its own Plugins?
- How do I extend one plugin I’m writing with another I’m writing using classes?
- How to create extendable wordpress plugins
- Some way to Flush or Overwrite all Imported Content in a Site for a Fresh Import – How?
- Which functions in theme or plugin load first
- Add CSS animation as Preloader to WordPress
- Image Crop/Resize Function/Code Sinppet/Plugin to adjust/crop images during upload
- WP get_permalink Return Wrong URL
- WP Plugin for Terms of Use
- How to add product images using script?
- Woocommerce: Changing the variations select default value? [closed]
- Automagic Link Shortening for Non-Hosted WP
- Setting up widgets in wordpress with a unique ID for the after_title argument
- Akismet plugin is deleting spam despite preferences
- MailChimp integration that allows users to select from multiple lists [closed]
- Distributing and packaging plugins
- Use plugin or custom post type for game score functionality
- Multiple Instances sharing the same database in a development environment
- How to Replace Words with Hypertext Link But Ignore Previously Existed Links?
- How to add rewrite rules and pagination to retrieve attachments files?
- Copyright messages for a particular set of pages
- FacetWP group listings by custom field [closed]
- Get IDs of Images from Gallery Block in InnerBlocks of a Custom Gutenberg Block
- How to embed HTML code from WP Coder plugin (or other) into Main Index Template of the theme
- WordPress plugin – Error “Plugin generate 2890 characters of unexpected output when activated”
- Input with spaces in Shortcode attributes overwritten by defaults
- Add a custom form on the post-new.php admin page
- Edit Yoast SEO breadcrumbs output [closed]
- Do widget options need to be escaped widget()?
- Is there any W3C compatible Share & Follow plugin?
- className not populating in custom block
- In the archive widget, how do I sort in between two years?
- Customization API for plugin development
- Fromcraft Plugin On click submit button [closed]
- creating a custom shop page display on archive woocommerce
- polylang + category/tag custom language link
- How to redirect users to their profile after they successfully edit their profile
- Getting Theme element into plugins page editor in wp admin
- GeoMashup plugin: how to customize cluster markers / icons? [closed]
- Creating Featured Content Boxes
- Basic gallery plugin suggestion [closed]
- Free paypal cart solution [closed]
- Which plugin can do horizontal scrolling of RSS feeds in WordPress [closed]
- I am trying to make a field show and save from quickedit screen
- Moving FB comments at the end of page
- Customizing a blog page layout
- Hide a certain category name from Related Posts
- how to add custom info on author page? plugin, child theme?
- How to handle a WordPress blog with articles in different languages?
- display unique post per category
- Widget where it can make changes to the container
- Call javascript functions from each page
- Can’t create new CPTs when menu hidden
- Gathering all Custom Post Type posts in to array/object the proper way
- Link Posts to External URL
- Multiple Post Thumbnails Plugin – Need help with code
- Custom Post Type, Custom Columns List
- How to prevent plugin, theme installation failures on WordPress?
- Check if theme supports sidebar
- WordPress search input in database, to edit information via form and update the database
- Adding category base to url in custom post giving 404?
- Post source link plugin – small modification
- Can we hide a certain user in WP?
- How Can I Increase Breadcrumb Position Count (Starting From 2)?
- WordPress hierarchy clarification, does post_type_archive take precedence over taxonomy-term archive?
- Create survey that redirects to sidebar menu customized to answers
- Load my Inline js footer area
- Move plugin upload folder from mywebsite.com/wp-content/uploads/pdfuploads to mywebsite.com/pdfs?
- Woocommerce list variations that are added already to cart in Single Product
- Flexslider empty slide
- How to fix slow comment query?
- Share on social media created listing after submission
- Translation plugin with default language?
- Best approach to serve static content within a regular page
- Custom pages with plugin
- WP plugin calls for custom pages
- Changing the body of mail sent to new user registration
- Which One Is Better For Managing Add Ons For Extensible Plugin?
- Multiselect value in wp_query
- get_var result empty for query of custom table in plugin admin
- Posts are deleted everyday at night
- [Custom field template plugin] Upload limited to 20 inputs file
- I want to remove the register/login WordPress top bar from my website
- Change the behaviour of archive cpt category and single cpt by plugin, not by theme
- do_shortcodes() isn’t working
- WordPress Code Access to Restricted Content without Registration
- What can I do to customize a widget provided with this plugin? from where have I to start?
- WordPress: code structure
- Can anyone tell some online tuts for plugin development for beginner? [closed]
- How to pre-set WordPress settings for specific posts?
- Create Custom Coupon Type
- Is website for online game guides doable in WordPress? [closed]
- Using ACF to allow user to add and edit multiple saved forms