code: def purge_portlets(portal):
      
      logger.info("Purging portlets ...")
  
      def remove_portlets(context_portlet):
          mapping = portal.restrictedTraverse(context_portlet)
          for key in mapping.keys():
              if key not in PORTLETS_TO_PURGE:
                  logger.info("Skipping portlet: '{}'".format(key))
                  continue
              logger.info("Removing portlet: '{}'".format(key))
              del mapping[key]
  
      remove_portlets("++contextportlets++plone.leftcolumn")
      remove_portlets("++contextportlets++plone.rightcolumn")
  
      # Reimport the portlets profile
      setup = portal.portal_setup
      setup.runImportStepFromProfile(profile, 'portlets')
      logger.info("Purging portlets [DONE]")
docs: Remove old portlets. Leave the Navigation portlet only