• Hi,

    I am running a multisite and need to be able delete a user together with their site using php. From what I can see I need to use the delete_site_option($option) function, but I am not sure what to use as the option?

    Any help or example could will be appreciated.

    Thanks

Viewing 4 replies - 1 through 4 (of 4 total)
  • Moderator bcworkz

    (@bcworkz)

    That deletes an option you may have stored. You will want to use wpmu_delete_user( $id );

    Thread Starter hhelmbold

    (@hhelmbold)

    Thanks for the response. Sorry I didn’t mention I am aware that I will have to use wpmu_delete_user( $id ) to delete the user, but that only removes the user, or will that remove the site associated to that user too?

    Moderator bcworkz

    (@bcworkz)

    Can’t say for sure, I don’t have multisite. Looking at the source code, it appears like it is deleting the site. Best to do a test to be sure.

    Thread Starter hhelmbold

    (@hhelmbold)

    I will test and give some feedback. I know if I do it manually via the dashboard the user and the site is not linked. I need to delete the user and the site seperately.

    I am a bit of a hacker though so I do things to make it work and not always the best way ?? Any chance you can give me a quick way of getting the user id if I have the username, or point me in the right direction?

    Thanks!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Deleting a user and site from multisite’ is closed to new replies.