Hi Aaron, this will delete a specific user's map areas. I've found the user.items() query to be lacking as well, so I always query user items with gis.content.search, like so:
from arcgis.gis import GIS
gis = GIS("home")
username_to_search = ''
user_map_areas = gis.content.search(query=f"owner:{username_to_search}",
item_type='Map Area',
max_items=10000
)
for area in user_map_areas:
try:
delete_result = area.delete()
if delete_result:
print(f"Map area '{area.title}' ({area.id}) deleted.")
except Exception as e:
print(f"! Deletion failed for map area '{area.title}' ({area.id}). Exception: {e}")