code: def hide_navbar_items(portal):
      
      logger.info("*** Hide Navigation Items ***")
  
      # Get the list of object ids for portal
      object_ids = portal.objectIds()
      object_ids = filter(lambda id: id in object_ids, NAV_BAR_ITEMS_TO_HIDE)
      for object_id in object_ids:
          item = portal[object_id]
          item.setExcludeFromNav(True)
          item.reindexObject()
docs: Hide root items in navigation