• Hello WordPressers!

    I have a question you might be able to help with. I currently manage WordPRess multi-site for a company and have about 177 blogs sites. All live under “blogs.company.com/sitename.”

    Is there a plugin, hack, or script that can be used to automatically delete a site based on values such as last accessed, last edited, etc?

    Thank you!!

Viewing 1 replies (of 1 total)
  • I need help too. Any script that can be automatically delete wordpress multisite Blogs Site according to time (example after 7 days). I had a script that can automatically delete a users according to time but how can I use it to automatically delete a blog site according to time? Below is the code:

    // automatically delete users after 1 days in wordpress
    if(!wp_next_scheduled(‘my_dailyClearOut’)) {

    wp_schedule_event(time(), ‘daily’, ‘my_dailyClearOut’); }

    function my_clearOldUsers() {
    global $wpdb;
    $query = $wpdb->prepare(“DELETE FROM $wpdb->users WHERE datediff(now(), user_registered) > 1 and id > 1”);
    if ($oldUsers = $wpdb->get_results($query, ARRAY_N)) {
    foreach ($oldUsers as $user_id) {
    wp_delete_user($user_id[0]);
    }
    }
    }
    add_action(‘my_dailyClearOut’, ‘my_clearOldUsers’);

Viewing 1 replies (of 1 total)
  • The topic ‘Auto Delete Blogs Site’ is closed to new replies.