Skip to content
Snippets Groups Projects

Delete CMS User

Description

This CiviCRM extension automatically deletes the associated WordPress user when a CiviCRM contact is deleted. It prevents errors where contacts cannot be deleted due to existing CMS user accounts.

Installation

  1. Upload this extension to wp-content/plugins/civicrm/civicrm/ext/
  2. In CiviCRM, go to Administer -> System Settings -> Extensions
  3. Click Refresh, then install "Delete CMS User."

How It Works

  • When a CiviCRM contact is deleted, this extension finds the linked WordPress user.
  • The WordPress user is deleted before deleting the contact.
  • If the user had content (posts/pages), it is reassigned to an administrator.

Testing

  1. Create a WordPress user and link it to a CiviCRM contact.
  2. Delete the contact in CiviCRM.
  3. Verify that the WordPress user is also deleted.