• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

XF 1.5 MySQL Query to Mass Unsubscribe Users From Admin Emails

#1
Hi, I'd like to mass unsubscribe all of my users with less than X posts from receiving admin emails. The mass user edit page didn't have the admin email setting as an option I can change, so I'm needing to do this with a direct database query.

What would that query be? I'm not familiar enough with XenForo's database storage to know where this setting resides.

Thanks!
 

Jake Bunce

XenForo moderator
Staff member
#2
Run this query on your database:

Code:
UPDATE xf_user_option AS uo
SET uo.receive_admin_email = 0
WHERE uo.user_id IN (
	SELECT u.user_id
	FROM xf_user AS u
	WHERE u.message_count < 10
);