I uploaded the managed package and submitted my app for security review, but I included an apex class (and its test controller) in the managed package that is not used in my app. The apex class was for testing purpose. I want to remove the apex class from the managed package.

How can I delete the apex class?

I have read this article:

In the article, it says I have to log a case in the Partner Community to enable Component Deletion in your packaging organization. Is that the only way to do it?

3 Answers 3


Yes and its not as easy as its looks like. I have done this once. First you need to raise a case with SF support for component deletion. Also you need to unistall this package from all places including any client if you have installed and your test org.

Now Salesforce support will revert it into beta version then you can remove the component and then again create the package and need to clear security review and then upload.


Yes, that is the way to do it. You log a case with Salesforce. It does not take that long and is not tedious at all (speaking from recent experience with this ). After that, they will enable deletion from your org. After this is enabled, it does not mean that you can remove the class from your package but still let it be in your org. What it means is that 'You can delete it from your org' and so to delete it from your next released version managed package, you must delete it from your org, so that its not included in the next version. Note that it will only be deleted if it is not making references to any other components in the managed package.

Also, you do not need to have anyone uninstall your app if it is already installed in someones org. Just make sure that deleting it does not affect any functionality.


You can try with deprecated annotation (@deprecated) before the class definition.I have used this for methods which are part of managed package.It will not delete the method/class but will indicate that the method/class is no longer usable for the application. For more information about @deprecated please refer the below link :


  • The deprecated annotation has side effects and you should carefully read the documentation before using it. It's intended for use with globals that can be called from outside the package. But there are other ways to accomplish the same end.
    – Ted Husted
    Commented May 14, 2021 at 7:46

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .