Delete "About me" for all users

AI-generated summary

alehandrof wants to clear the “About me” field for all users after disabling an integrated system that auto-managed it. pfaffman suggests running a Rails command to update the bio_raw and bio_cooked fields to nil, advising to test it on a single user first. When alehandrof tries it, the bio doesn’t appear to change — and they can’t even see the “About me” section to edit. Canapin confirms the code works and explains that the bio field is hidden if discourse connect overrides bio is enabled — but alehandrof confirms the setting is disabled. pfaffman suggests reloading preferences or trying safe mode to rule out interference. Finally, alehandrof discovers the issue was a theme stylesheet hiding the profile fields — removing it resolves the problem. The bio-clearing command works as intended once the UI is visible.

I’d like to delete the content of the “About me” field for all users. How could I do this?

(We are switching away from in integrated website that automatically managed this field with metadata, in favor of custom fields and allowing users to update their “About me” field from within Discourse.)

I think it’s

UserProfile.all.update_all(bio_raw: nil, bio_cooked: nil)

You should test it first, perhaps on a single user like this:

UserProfile.where(user_id: 1).update_all(bio_raw: nil, bio_cooked: nil)

Hi Jay! Apologies for taking so long to respond. I got sidetracked by other projects, but now I’m finally coming back to this.

I disabled the discourse connect overrides bio setting and tried the command to remove the bio from one user (me). Unfortunately, it doesn’t seem to do work.

Any other ideas?

Edit: I don’t understand why, but when I look at my profile I can’t see an “About me” section to edit at all. Maybe these two issues are related?

I confirm Jay’s code is correct and properly erases any bio (including @discobot’s! :robot: )

The bio field won’t be displayed if discourse connect overrides bio is enabled.

I have this setting disabled (unticked), but I can’t edit my bio. Do I need to refresh or update the system in some way? Otherwise, the system still won’t show me the “About me” field on the profile preferences page.

Not sure what’s going on!

It’s possible that you need to reload your preferences after changing those settings. Or maybe you have some other customizations that are interfering. You might try safe mode.

Thank for that safe mode suggestion! The issue ended up being the theme’s stylesheet – it was hiding some of the profile fields. I removed that code and it now works fine.

Thank you both for the help!