SQL queries to clear stored DOBs and auto-fill a custom age field?

alfaNova

Well-known member
Licensed customer
Hi everyone,

I recently updated my registration settings to use a basic age confirmation checkbox and completely disabled the Date of Birth requirement.

I am now looking to do two things via SQL to clean up my database:

1. Delete existing DOB data: To minimize the personal data we hold, I want to clear all previously stored DOB information. What is the safest query to reset the DOB fields for all users (presumably in xf_user_profile)?

2. Auto-tick the new Age Confirmation field for existing users: I created a new custom user field (ID: yas_onay) for the new registration age check. Because I am 100% certain that all currently registered users on my forum meet the age requirement, I want to automatically tick/fill this custom field for all existing members so they aren't forced to do it later.

Could someone please provide the correct SQL queries for both of these tasks?

Thanks in advance for the help!
 
1. Delete existing DOB data: To minimize the personal data we hold, I want to clear all previously stored DOB information. What is the safest query to reset the DOB fields for all users (presumably in xf_user_profile)?

Reset birthday user profile fields:

SQL:
UPDATE xf_user_profile 
SET dob_day = 0, 
    dob_month = 0, 
    dob_year = 0;

Reset birthday user option fields:

SQL:
UPDATE xf_user_option
SET show_dob_year = 0, 
    show_dob_date = 0;
 
Back
Top Bottom