Skip to:
Content
Pages
Categories
Search
Top
Bottom

Problem deleting user AND blog


  • dasteralo2
    Participant

    @dasteralo2

    Hello,
    A user can delete his account but in the database there is still some occurences (in wp_blogs for example and few other tables) of the blog he created so it’s impossible to create a new blog with the same name even if the user don’t exists anymore.
    Do you have any ideas of how i can find a solution to that problem ?
    Hope my english is not so bad!
    Thanks!!

Viewing 7 replies - 1 through 7 (of 7 total)

  • Aeryn-Lynne
    Participant

    @aeryn-lynne

    If you have access to the database, I would either a: delete/drop the instances of the old user entirely so there is no issue for new subscribers with similar needs, OR b: go into the specific area of where the blog name sits in the database and edit the name field to “OLD_name of blog”. I’d expect that you’d really only need one character difference in the OLD filed for someone else to use the original blog name.

    It might confuse Google and SEO for a bit if the old blog was active for a long time, but if you’re not concerned about that, there shouldn’t be any issues.

    I’d like to add a caveat though… Before you do *anything* to your database, please back it up to your computer harddrive first, ’cause if the suggestions I give you turn out to create more errors you’ll probably need to import the untouched database to fix any issues (and its good practice to make a back up anytime you decide to work directly within your database).


    dasteralo2
    Participant

    @dasteralo2

    Thanks a lot for your answer.
    But is there any possibilty to delete old blogs at the same time of deleting a user without entering the database ? Doing it manually in the database would be so binding.
    I precise that the blogs steal appear in my wordpress admin but not in buddypress. i would like them to be deleted at the same time as the user account is deleted

    Have you searched the WordPress.org forums? That’s the better place, as this doesn’t seem to be related to BuddyPress.


    dasteralo2
    Participant

    @dasteralo2

    I’ll try to search WordPress forums.
    Thanks


    shanebp
    Moderator

    @shanebp

    >A user can delete his account

    That’s a BP item.
    You can change the settings here and have them contact the site admin to delete their account
    /wp-admin/admin.php?page=bp-settings

    Then you can use wp-admin/users.php to delete the user and all their blogs & posts

    If you want users to be able to delete their own accounts and have all their blogs & posts deleted at the same time, you’ll have to write some custom code.


    shanebp
    Moderator

    @shanebp

    There is a hook …
    `do_action( ‘bp_members_delete_account_after_submit’ );`
    in /bp-default/members/single/settings/delete-account.php

    You could quite easily use that hook and write a function that will delete the user’s blogs & posts.
    And that way you could leave the /wp-admin/admin.php?page=bp-settings to Yes to allow users to delete their account.


    dasteralo2
    Participant

    @dasteralo2

    Great!! Thank you very much.
    But can anyone give me some trail in order to write some “custom code” in delete-account.php so that the blogs associated to a user are deleted at the same time he delete his account.
    I am a very bad code writer :) That would be sooo helpful

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Problem deleting user AND blog’ is closed to new replies.
Skip to toolbar