Cleanup Properties
by @tomgranot
Archive or delete unused custom properties across all HubSpot object types (contacts, companies, deals). Identifies Salesforce sync properties, test/temp pro...
clawhub install cleanup-propertiesπ About This Skill
name: cleanup-properties description: "Archive or delete unused custom properties across all HubSpot object types (contacts, companies, deals). Identifies Salesforce sync properties, test/temp properties, and obsolete form fields." license: MIT metadata: author: tomgranot version: "1.0" category: ongoing-maintenance
Cleanup Properties
Remove or archive unused custom properties. Property bloat slows down forms, confuses users, and makes data mapping harder.
Prerequisites
.envhubspot-api-client installed via uvStep-by-Step Instructions
Stage 1: Before β Inventory All Custom Properties
Pull properties for each object type:
from hubspot import HubSpotapi_client = HubSpot(access_token=os.getenv("HUBSPOT_API_TOKEN"))
for obj_type in ["contacts", "companies", "deals"]:
props = api_client.crm.properties.core_api.get_all(
object_type=obj_type
)
custom_props = [p for p in props.results if not p.hubspot_defined]
For each custom property, record: name, label, object type, type, group, number of records with a value (requires search queries), whether it is used in any form/workflow/list.
Stage 2: Execute β Identify Candidates for Deletion
Safe to delete:
Handle with care:
hs_salesforce_* prefix or mapped in sync settings) β do not delete without coordinating with the Salesforce adminArchive instead of delete when:
Stage 3: After β Delete or Archive
1. Archive properties first (HubSpot supports property archiving). 2. Wait 30 days, then delete archived properties that caused no issues. 3. Document all changes in a cleanup log.
Stage 4: Rollback
Tips
team_purpose_detail).βοΈ Configuration
.envhubspot-api-client installed via uvπ Tips & Best Practices
team_purpose_detail).