The MU forums have moved to WordPress.org

automatically Delete blog from database (4 posts)

  1. Opticalworm
    Member
    Posted 13 years ago #

    Hello everyone,
    After a long day prowling the forums, both in wp and wpMU, I've finally decide that it was time to post my question.

    Does anyone know how to delete a blogs automatically after a user linked to that blog has been deleted?

    I've already writing a plugging that will automatically create a blog for every newly register users. (I used user_register action hook for that)
    Out of force of habit [thank you mum], I like cleaning after myself. So a plugging that will remove that blog after the user has been delete is a must have.

    Any ideay anyone?

  2. dsader
    Member
    Posted 13 years ago #

    The "what ifs" first:

    What if ... the user is a member of several blogs/sites?

    What if ... the blog to be deleted has other members in it?

    What if ... the SuperAdmin aka SiteAdmin is just plain terrified of a plugin that auto deletes anything?

    That said, removing a pile 'o blogs is tedious. But deleting a legit blog by accident would be a huge problem.

    Try WPMU Power Tools, there's bound to be a snippet you can load there that will purge your domain of cruft.

  3. Opticalworm
    Member
    Posted 13 years ago #

    Thank you dsader, that a nice plugging.

    Generally, for my site, the user will only have one blog assigned to them and as many pages as they care to make.
    However, you do bring a good point, what if there are other users assigned to that blog that help maintain it. (Food for thought)

    the way I see it, the user account will only be deleted if the material infringes the site rules or the user decide to deactivate there account. so i guess it might be just be worth writing a plugging that list all blog without users so that i can decide the best course of action.

    Again thank you for the help. I just tried Power tool plugging (I love it) and the best bit, is that it also has code sample to shows how to delete blogs. Nice :)

  4. andrea_r
    Moderator
    Posted 13 years ago #

    The user can't delete their own user account. they *can* delete their own blog though. Which really only deactivates it, and it won't show on any blog listings on the front end anyway.

About this Topic

  • Started 13 years ago by Opticalworm
  • Latest reply from andrea_r