Skip to:
Content
Pages
Categories
Search
Top
Bottom

Having a spring clean – most efficient way to clean up the activity stream?


  • rossagrant
    Participant

    @rossagrant

    Hey guys,

    So I’m having a clean out.

    I’ve ran a popular site for 5 years now and I’m giving it a tidy up before new development in 2016.

    I’ve just deleted a few forums and hundreds of dead topics.

    I’m now looking to clean out the activity stream of old, dead links and stuff that may not have been cleaned up upon deletion of content.

    Am I okay to just clear the db table for bp_activity and bp_activity_meta

    I’m guessing that will set me up for a clean slate?

    I’ll then re-publish the last few blog posts on my site to re-populate the stream a bit.

    Any other tables I need to clear out or a better way to do this?

    I’m also guessing stream items DON’T get indexed by Google? I’m not going to create loads of broken results?

    Cheers!

    Ross 🙂

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

  • Henry Wright
    Moderator

    @henrywright

    Am I okay to just clear the db table for bp_activity and bp_activity_meta

    I wouldn’t do this because if anyone has notifications which point to the items you delete, then the member will be taken to a broken link.

    I’m also guessing stream items DON’T get indexed by Google? I’m not going to create loads of broken results?

    There’s nothing in BuddyPress which would stop Google indexing the single activity page. In fact, I bet that page does get indexed, not sure how popular it’d be in the results list though.

    Hope this helps?


    Henry Wright
    Moderator

    @henrywright

    Just to add, if you are looking for something to delete, old notifications might be a good place to start. The usual way (in BuddyPress) is to keep all of these, but many places around the web nuke them after they’re ~7 days old.


    rossagrant
    Participant

    @rossagrant

    Ahh, okay – thanks Henry!

    So is the general consensus that you never purge the stream?

    What if I emptied the DB of notifications, then purged the stream?

    I just know it will contain lots of old, dead links – particularly now I’ve deleted lots of forums etc.


    Henry Wright
    Moderator

    @henrywright

    So is the general consensus that you never purge the stream?

    Personally I wouldn’t, because members might ask where their old status updates have gone if they ever decide to look back over them. But that’s just my opinion rather than a consensus. Whether it’s a good idea will depend on many things:

    • Are old items out of date (contain lots of broken links etc)?
    • Will site members mind loosing their old updates?
    • Will deleting old items cause broken links (notifications for ex)?

    As you can see, it’s as much of a business decision as a technical one.

    If you did decide to wipe out old activity items, I’d probably go down the route of also clearing old notifications.


    rossagrant
    Participant

    @rossagrant

    Hey Henry!

    I don’t think site members would mind about losing old updates at all and the stream will contain old, broken links in parts yep.

    Notifications is the only issue that I’d be concerned with.

    Is there a table in the DB that deals specifically with notifications?

    If so, I guess I could just empty it before I emptied the stream and stream meta tables.

    Shout up if anyone thinks that could be a problem.

    Thanks again Henry!


    rossagrant
    Participant

    @rossagrant

    Actually @henrywright – I just noticed there is indeed a notifications table and a notifications meta table.

    There’s a separate table for message notifications, which I would leave well alone.

    I guess the only other notifications that would be useful to keep intact would be the friendship requests. If I deleted notifications, would people lose the ability to accept friend requests?

    Not quite sure where they are stored.


    Henry Wright
    Moderator

    @henrywright

    Is there a table in the DB that deals specifically with notifications?

    Yes. That’d be bp_notifications

    If so, I guess I could just empty it before I emptied the stream and stream meta tables.

    Shout up if anyone thinks that could be a problem.

    Instead of deleting directly from the database, you should use these functions:

    • bp_notifications_delete_notifications_by_type()
    • bp_notifications_delete_notifications_by_item_id()
    • bp_notifications_delete_all_notifications_by_type()
    • bp_notifications_delete_notifications_from_user()

    Alternatively, if none of these quite suit your need, go straight for the class method:

    • BP_Notifications_Notification::delete()

    Henry Wright
    Moderator

    @henrywright

    If I deleted notifications, would people lose the ability to accept friend requests?

    If you deleted friend request notifications, members would still be able to accept those friendship requests, they’d just have to go to their friend requests page and click accept or reject as usual.

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Having a spring clean – most efficient way to clean up the activity stream?’ is closed to new replies.
Skip to toolbar