It depends on the use case:
- If you want to undeploy the plugin from all vSphere Client instances connected to the (possibly multi-vCenter) environment, use the UnregisterExtension API of the vCenter ExtensionManager.
- If you want to block deployment of the plugin on a particular vSphere Client instance, mark it as incompatible in the compatibility-matrix.xml on the vCenter Server. This could probably be automated but please keep in mind the folder location of the matrix is not a public API and might change in future versions.
- If you want to keep the plugin deployed but hide its extensions on a particular vSphere Client instance, disable it from the Client Plugins view. There is no public API to achieve this.
Normally, the management of plugins is not supposed to be done by the plugin itself but handled externally via the vCenter Server APIs (point 1 above).
If you have a specific use case that does not fit this picture please provide more details so we analyze further.