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

XF 1.2 Updating custom field values


Active member
My new website I have XenForo as the member authentication and session manager. I have a custom field created in XF with 3 options, the values being 1,2 and 3.

I have the same field in my own tables outside of XenForo keeping track of this particular setting for the users. I've just added in the function for them to change this option in the main site and I am having issues manually updating the value in the xf_user_field_value table. This is my SQL

INSERT IGNORE INTO xf_user_field_value (user_id, field_id, field_value) SELECT xf_id, 'necromunda_ruleset', ruleset FROM necro_profile WHERE id = 1 ON DUPLICATE KEY UPDATE field_value = 3
This query works and the correct value is updated in the table for the particular user and when I go into the profile on the admin backend it shows the correct setting for the custom field as well. However on the forums itself where I have the field setting displayed (user area in message) it doesn't change what is displayed for the user. Simply entering the password for the user in the admin section and saving without changing anything will make the forum display for that field correct.

Am I missing something obvious?

Jake Bunce

XenForo moderator
Staff member
That is because those values are cached in xf_user_profile.custom_fields. Editing and saving a user in the Admin CP prompts a rebuild of that cache.


Active member
Well that explains it. Is there an existing function I can tap into to process the field value change and update the cache?