I think what you meant to say is that you'd like to remove the contents of a given template in memory, because your plugin is already executing a different plugin. I had exactly the same requirement and I solved it like this (change template name as appropriate):