The MU forums have moved to WordPress.org

[Hack] Automatically delete inactive blogs (34 posts)

  1. stutley
    Member
    Posted 17 years ago #

    Warning: Do not run this script on a livesite unless you know what you're doing! ;)

    I have been playing around with a script that could automatically delete inactive blogs. I haven't tested it properly yet, but it's been made available here.

    I programmed it with the idea, that it should be executed once every day - e.g. by a cronjob or manually.

    There are some basic settings which should be pretty self-explanatory.

    What it does is twofold:

    1. Send an email to the owner of all blogs that haven't been updated for e.g. 7 days (configurable) saying that their blog will be deleted when it's been inactive for 30 days (also configurable).

    2. Automatically deletes all blogs that have not been updated for the past 30 days (configurable) and notify the blogowner by email that it has been deleted.

    The script deletes all bloginformation and -data but not the users data.

    Requests, suggestions and bug reports are very welcome!

    Warning: Do not run on a livesite unless you know what you're doing! ;)

  2. stutley
    Member
    Posted 17 years ago #

    Woot! I test-ran the script (only the warning-part) on my livesite and two bloggers almost immediately updated theirs blogs! :D

  3. drmike
    Member
    Posted 17 years ago #

    I like how you have the MySQL information within the file instead of just using the config.php of the WPMU setup. That way, when testers try this out on a dupe of their database, they can point it at that instead of teh real database. (I wonder if anyone will take the hint.)

  4. mypatricks
    Member
    Posted 17 years ago #

    It's seen notify email sending every 1 minutes, this will spam the blogger mail box.

  5. stutley
    Member
    Posted 17 years ago #

    >It's seen notify email sending every 1 minutes, this will spam the blogger mail box.

    No, it won't - why do you think that? :)

    It will only send out notify emails, when you run the script. It can't do anything on its own :)

    When I'm finished with it and have tested it, I'll set it up to run once a week.

  6. mypatricks
    Member
    Posted 17 years ago #

    I installed it into mu-plugin and received 17 emails for single blog.

    Now I enabled it, it's ok! thanks!

  7. stutley
    Member
    Posted 17 years ago #

    Oh, ok. Well, I wrote in the file that it is not a plugin. I guess if you install it in the mu-plugins folder, it will be executed basically everytime you open the site.

    But it's not really finished yet - I'll add more features and security in the coming days ;)

  8. drmike
    Member
    Posted 17 years ago #

    Probably doesn't need to be a plugin. I like how it sits outside of the MU program.

  9. Frequent
    Member
    Posted 17 years ago #

    I look forward to seeing the finished product stutley. I've been doing this manually for too long.

    Freq---

  10. drmike
    Member
    Posted 17 years ago #

    - How about using the user's name if present?

    - A link to their blog so that they can remember it?

    - Delete if also no posts found option?

    - Report on blogs getting warning emails. Not just the deleted ones.

  11. drmike
    Member
    Posted 17 years ago #

    Never mind the last one. Gotta it shortly after posting that.

    Sorry for the confusion. :)

    -drmike

  12. stutley
    Member
    Posted 17 years ago #

    Thanks for the inputs ;)

    # 1 : I'm definitely going to do that one.
    # 2 : I've already made a link to the users login-page, but it's no problem providing a link to the blog.
    # 3 : Yeah, but it would be optional. On my site, new blogs are created without posts, so deleting them would sometimes delete blogs that shouldn't be.

  13. drmike
    Member
    Posted 17 years ago #

    #3) They could always sign up again and, if they haven't posted anything after 30 days, they're probably not going to post anyway.

    It's been suggested before. Killing two birds with one stone kind of thinking.

    thanks,
    -drmike

  14. ejai2003
    Member
    Posted 17 years ago #

    this is really a good plugins .. i seriously love the idea .. but what if the blogger goes to vacation for more then 30 days and i set the delete time in 30 days .. this will make the blogger sad :P ... a vacation mode might be a good idea to solve this problem.

  15. stutley
    Member
    Posted 17 years ago #

    > a vacation mode might be a good idea

    Yes, but I think that would have to be set inside WPMU somehow. 30 days is just an example. I know of sites that don't categorise blogs as inactive before they haven't been updated for 6 months :S

    When I'm done I'll provide a link within the signup-process to my terms of use so people will know what the deal is about (if they read them, of course :).

    By the way: I say it again, this is not a plugin but a stand alone script ;)

  16. nims
    Member
    Posted 16 years ago #

    Hi stutley, any new updations to this script ?

  17. wild26
    Member
    Posted 16 years ago #

    We want this. Is it done yet?

  18. drmike
    Member
    Posted 16 years ago #

    I think you mean "you" want this. :)

  19. michaelfoo
    Member
    Posted 16 years ago #

    I would love to hear some updates from stutley too.

    Perhaps an idea of deactivating inactive blog (30 days) just like suggested here:
    http://mu.wordpress.org/forums/topic.php?id=1581&replies=6

    And delete of that blog after 60 days will be just nice?

    Thanks.

  20. nims
    Member
    Posted 16 years ago #

    Its long time since stutley has replied. I wonder, if he is really developing it or not :-(
    Cud have been a nice contribution to the community.

  21. enseignement
    Member
    Posted 16 years ago #

    Any update on this very very nice tool ? ?

  22. BradWaite
    Member
    Posted 16 years ago #

    Why not use the built-in wpmu functions to do what you need? For example:

    wpmu_delete_blog($blogid, true).

  23. Konstan
    Member
    Posted 16 years ago #

    This script gave me an idea for my site. I'll check this script out later to see if I can make it send emails to inactive blogs to remind users they have the blog.

    I dont want to delete, just send them an email saying use your blog!

  24. andrea_r
    Moderator
    Posted 16 years ago #

    Now there's an excellent idea... I've had users email me who have forgotten their login details (username and address, let alone password) and wanted to get back in. One account was a year neglected.

  25. enseignement
    Member
    Posted 16 years ago #

    Is there someone who updated this script ? Is it still working for 1.3 ?

  26. andrea_r
    Moderator
    Posted 16 years ago #

    doesn't look it.

  27. demonicume
    Member
    Posted 16 years ago #

    i used it this weekend. it works fine.

  28. andrea_r
    Moderator
    Posted 16 years ago #

    I meant it doesn't look as if anyone updated it. :)

  29. blogono
    Member
    Posted 15 years ago #

    this sounds like a very nice plugin. i assume that there are still no updates yet??

    did anybody test it with the current version??

    moreover, i would suggest to send two emails .. eg. one mail warning that the blog will be deleted in one week & second mail warning that the blog will be deleted tomorrow

  30. demonicume
    Member
    Posted 15 years ago #

    i've used it. its great.

About this Topic

  • Started 17 years ago by stutley
  • Latest reply from paraisofan