Merging user accounts

:bookmark: This guide explains how to merge multiple user accounts into a single Discourse account. It covers merging non-staff users through the Discourse UI and merging staff users via the console.

:person_raising_hand: Required user level: Administrator

Merging user accounts in Discourse allows you to combine multiple accounts into a single one. This process can be useful in several scenarios:

  1. When a user creates multiple accounts, perhaps due to forgetting their previous registration.
  2. If a user creates a new account with a new email address instead of updating their existing one.
  3. When a user wants to consolidate multiple accounts used for different purposes (e.g., personal, business, or testing) into a single account.

Merging non-staff users

Administrators can merge non-staff users directly through the Discourse UI.

:warning: This action is irreversible. The source user account will be deleted after the merge.

To merge two non-staff users:

  1. Navigate to the user admin page of the source user (the account you want to merge from).
  2. Scroll to the bottom of the page.
  3. Click the “Merge” button.
    Merge button location
  4. In the popup window, enter the username of the target account (the account you want to merge into).
  5. Click the “Transfer and Delete” button to initiate the merge.
    Merge confirmation dialog

:information_source: Merging large accounts can be resource-intensive and may take some time to process, depending on the amount of data associated with the source user.

What gets merged?

When merging user accounts, Discourse combines data from 45 tables, including:

  • Posts and topics
  • Likes given and received
  • Private messages
  • User profile information
  • User preferences and settings
  • User actions and activity (e.g., bookmarks, topic views)
  • Badges and achievements
  • Trust level and group memberships

In case of conflicts, the target user’s details are kept. If both users had an anonymous user associated with their account, the one owned by the source user will be lost.

:warning: Incoming links referencing the source user (e.g., won’t be associated with the target user after merging.

Important note about merging users and SSO

Merging user accounts can potentially impact SSO, depending on the implementation:

  • If SSO is based on email address, there should be no issues as long as the target account’s email is used in the SSO system.
  • If the SSO system uses a unique user ID different from the Discourse user ID, merging could cause issues if the source account’s unique ID is not correctly mapped to the target account.

Merging staff users

For security reasons, merging staff users must be done via the console.

:information_source: If your site is hosted with Discourse, contact for assistance with merging staff users.

To merge staff users via the console:

  1. Access the rails console for your site.
  2. Execute the following command:
    rake users:merge['source_username','target_username']

    :warning: Ensure there are no spaces before or after the comma in the command.


Q: What happens if the merge process seems to stall?
A: If the merge progress screen shows no change for an extended period, try refreshing the page. The merge may have completed, but the UI didn’t update.

Q: Can I undo a user merge?
A: No, once two users are merged, the action cannot be undone. The source user account is permanently deleted after the merge.

Q: Will merging users affect their posts and topics?
A: All posts and topics from the source user will be transferred to the target user. The authorship of these items will change to reflect the target user as the creator.

Last edited by @hugh 2024-07-09T03:47:10Z

Last checked by @hugh 2024-07-09T03:47:16Z

Check documentPerform check on document:

I’m just curious. Why is it important not to have a space and what happens if you have a space next to the comma?

Hi Team,

I am reaching out regarding an issue I’m experiencing with an account merger process that I initiated on Friday morning using the user/Admin UI.

The "Merge progress" has shown no change since Friday afternoon, consistently displaying “Changing post ownership”. Although I’m aware that merging accounts with numerous posts can be time-consuming, the lack of progress over several days is concerning.

I don’t see any relevant entries in the UI error log. At this point, I’m seeking guidance on how to validate whether the merger job is progressing as intended or if it has stalled?

If you refresh, the merge probably finished, IIRC this happened to me a while back, and it did merge, the UI for it just didn’t go away.


Thanks, @Firepup650! After refreshing, the progress screen vanished, and I was redirected to the user’s target profile page. Interestingly, it seems that the merger didn’t occur at all. I’ll give it another try. TY!

1 Like

4 posts were split to a new topic: Don’t log all post edits in staff action logs for a user-merge