Set user privacy options using SQL queries

Set user privacy options using SQL queries

Paul B

XenForo moderator
Staff member
Brogan submitted a new resource:

Set user privacy options using SQL queries (version 1.0) - Quickly and easily update all members.

These queries will update the privacy preferences for all existing members, overriding what they have already set.

These queries would typically be used after an import.

Copy and paste the code below into phpMyAdmin.

The following settings will change all privacy options to members only.

Rich (BB code):
UPDATE xf_user_privacy SET allow_view_profile = 'members';
UPDATE xf_user_privacy SET allow_post_profile = 'members';
UPDATE xf_user_privacy SET...

Read more about this resource...
 
Since the import of our big board, I've noticed many of the profiles still have the default "everyone" setting, yet I do not want to upset any changes that a few members may have already made to tighten up their privacy. With that in mind, here is some altered SQL to at least get rid of the "everyone" flag:

Code:
UPDATE xf_user_privacy SET allow_view_profile = 'members' where allow_view_profile = 'everyone';
UPDATE xf_user_privacy SET allow_post_profile = 'members' where allow_post_profile = 'everyone';
UPDATE xf_user_privacy SET allow_receive_news_feed = 'members' where allow_receive_news_feed = 'everyone';

...and so on.
 
UPDATE xf_user_privacy SET allow_view_profile = 'members';# 60835 rows affected.

UPDATE xf_user_privacy SET allow_post_profile = 'members';# 11952 rows affected.

UPDATE xf_user_privacy SET allow_receive_news_feed = 'members';# 60854 rows affected.

UPDATE xf_user_privacy SET allow_send_personal_conversation = 'members';# 11954 rows affected.

UPDATE xf_user_privacy SET allow_view_identities = 'members';# 60833 rows affected.

:)
 
Top Bottom