Programmatically remove a portlet from a page

thumbnail
Steve Weiss, modified 7 Months ago. Regular Member Posts: 112 Join Date: 9/20/11 Recent Posts

I'm trying to write code that will remove a portlet from a page. I've found this article: Remove portlets programmatically with the removePortletId method, but the solution presented there doesn't quite do the entire job. It does seem to clean out the portlet configuration, since when I reload the page I get the "portlet is not configured" message. But the portlet is still on the page, and I would like to remove it entirely. Is there a way to do this?