social.plus SDK enables permanent community deletion for authorized users when communities are no longer needed. Community deletion removes all associated data including posts, comments, members, and metadata, making this an irreversible operation that requires careful implementation.

Permanent Deletion

Completely remove communities and all associated data

Permission Control

Restrict deletion to authorized creators and moderators

Data Cleanup

Remove posts, comments, members, and metadata automatically

Safety Measures

Implement confirmation flows and backup strategies

Delete Community

The SDK provides a way for creators or moderators to delete a community by calling the deleteCommunity method. In the JavaScript SDK, this method is referred to as the closeCommunity method. To delete a community using this method, users can call the method and provide the communityId as a parameter. This will trigger the deletion process, which will remove the community and associated community data.
It is important to note that deleting a community is a permanent action and cannot be undone. As such, it is recommended that users exercise caution when deciding to delete a community and ensure that they have taken all necessary precautions to preserve any important content or data associated with the community.

Parameters

ParameterTypeRequiredDescription
communityIdStringYesUnique identifier of the community to delete

Permission Requirements

RoleDelete PermissionNotes
Community CreatorYesCan delete their own communities
Community ModeratorYesCan delete communities they moderate
AdministratorYesCan delete any community with proper permissions
Regular MemberNoCannot delete communities

Data Removal Impact

When a community is deleted, the following data is removed:
  • Community Profile: Name, description, avatar, metadata
  • All Posts: Text, images, videos, polls, and custom posts
  • All Comments: Comments and replies on community posts
  • Member List: All community memberships and join requests
  • Stories: Community stories and their associated data
  • Settings: Post moderation settings and story configurations
communityRepository.deleteCommunity(withId: "community-id") { success, error in
    // Handle the result.
}

Pre-Deletion Considerations

Data Backup Strategies

Before implementing community deletion, consider these backup approaches:
  1. Export Community Data: Allow admins to export posts and member lists
  2. Migration Options: Migrate content to other communities
  3. Member Notification: Notify members before deletion with backup options

Member Management

Handle member relationships during deletion:
  • Active Members: Automatically remove all memberships
  • Pending Requests: Cancel all pending join requests

Best Practices

Safety First: Implement multiple confirmation steps and consider a “cooling off” period for community deletion requests to prevent impulsive decisions.

Implementation Guidelines

  1. Multi-Step Confirmation: Require multiple explicit confirmations
  2. Name Verification: Make users type the community name to confirm
  3. Permission Checks: Verify user permissions before showing delete options
  4. Loading States: Show clear progress during deletion operations
  5. Success Feedback: Provide clear confirmation of successful deletion

User Experience Considerations

  1. Clear Warnings: Emphasize the permanent nature of deletion
  2. Data Export: Offer data export before deletion
  3. Member Communication: Provide tools to notify community members
  4. Navigation: Handle post-deletion navigation appropriately