To delete a profile field group, you can use xprofile_delete_field_group()
. The function accepts the ID of the field group you wish to delete.
To delete a specific field, you can use xprofile_delete_field()
. This function accepts the ID of the field you wish to delete.
Thanks !
I have to put in in my function.php file ? Is there a specific place ?
And where can I find the iDs of the fields ?
You could put it in your functions.php file, or even your bp-custom.php file if you have one. It only needs to be run once so make sure you remove it after visiting your website in a web browser.
Finding the group ID or the field ID is something you’ll need to do yourself. Take a look in your database and find table bp_xprofile_fields. Then look for the id column and the name column. Say the name of the field you want to delete is ‘Social’. Just look for ‘Social’ in the name column and find the id of that particular row. Then you have your field ID.
You can get the ids by going to .../wp-admin/users.php?page=bp-profile-setup
Click or roll-over the Edit links for group or single field.
And you’ll see group_id & field_id.
btw – you can delete groups and / or single fields on that wp-admin page.