Skip to content

How to undelete a user on a Mastodon instance: A small guide for admins

Published: May 30th, 2024 Mastodon Picture of a blue garbage container with a recycle icon on it

Mastodon, the decentralized social network, offers a flexible and privacy-focused alternative to mainstream social media platforms. However, managing a Mastodon instance comes with its own set of challenges, including handling user accounts.

One issue that administrators might face is the need to undelete a user who was accidentally deleted or wants to restore their account. This small note will guide you through the process of undeleting a user on a Mastodon instance and explore some common use cases for this action.

Use cases for undeleting a user

  1. Accidental deletion:

    • An admin might mistakenly delete a user account. Restoring the account prevents data loss and maintains the user’s presence on the platform.

  2. User regrets deleting their account:

    • Sometimes users delete their accounts impulsively and later regret the decision. Allowing admins to restore these accounts provides flexibility and user satisfaction.

  3. Security and moderation Issues:

    • In cases where an account was deleted due to a security issue or moderation error, undeleting the account can help in rectifying mistakes and ensuring fair treatment of users.

  4. Account recovery for inactive users:

    • Users who return to the platform after a long period of inactivity might find their accounts deleted. Restoring these accounts can help in re-engaging users and maintaining community continuity.

Step-by-Step guide to undeleting a user

Undeleting a user on Mastodon requires access to the instance’s command prompt. Here are the steps you need to follow:

  1. Access the Mastodon instance:

    • Connect to your server where the Mastodon instance is running. You will need appropriate user access to run administrative commands.

  2. Identify the user:

    • Ensure you have the username or email of the user who needs to be undeleted. This information is crucial for the restoration process.

  3. Use tootctl to restore the user:

    • The tootctl tool provides a straightforward command to undelete a user. This command reuses an old USERNAME with associated EMAIL after its account has been deleted and re-enables the user account.

tootctl accounts create USERNAME --reattach --force --email EMAIL
bash

After running the command, it's essential to verify that the user has been successfully restored. You can check this through the Mastodon web interface or by querying the account details again.

Conclusion

Undeleting a user on a Mastodon instance is a valuable skill for administrators, ensuring that mistakes can be rectified and users can return to the platform smoothly.

By using the tootctl tool, admins can efficiently manage user accounts and maintain a healthy and active community. Remember to always back up your instance before making any changes to avoid any unintended consequences.

Cover photo by rivage

About Marcel Bootsman

Marcel discovered the web in 1995. Since then he has paid attention to and worked with lots of technologies and founded his own WordPress oriented business nostromo.nl in 2009.

Currently Marcel is Business Development Manager Dutch & DACH Markets at Kinsta where he helps Kinsta's client base grow with Managed WordPress, Application, Database and Static site hosting.

You can contact Marcel on a diverse range of online platforms. Please see the Connect section on the homepage for the details.