Support Forum

Advanced Search
Forum Scope


Match



Forum Options



Minimum search word length is 3 characters - maximum search word length is 84 characters
plugins-topic
Prune Database Request
Avatar
Tal
Member
Free Members
sp_UserOfflineSmall Offline
Apr 2, 2015 - 7:01 am

Wordpress version 4.1.1

Simplepress version 5.5.5

All other plugins are up to date as of right now.

Avatar
Yellow Swordfish
Glinton, England
SP Master
sp_UserOfflineSmall Offline
Apr 2, 2015 - 9:32 am

This - as far as I can tell without spending a week testing and analysing! - should do the trick. I am only concerned that it might leave a record behind here and there but nothing, I believe, that would cause any concern. Just perhaps the odd orphaned row.

So this is a series of queries you can run directly:

DELETE FROM wp_sfdigest WHERE topic_id = XXXXX;
DELETE FROM wp_sflinks WHERE topic_id = XXXXX;
DELETE FROM wp_sfpostattachments WHERE topic_id = XXXXX;
DELETE FROM wp_sfposts WHERE topic_id = XXXXX;
DELETE FROM wp_sftagmeta WHERE topic_id = XXXXX;
DELETE FROM wp_sftopics WHERE topic_id = XXXXX;
DELETE FROM wp_sftrack WHERE topic_id = XXXXX;
DELETE FROM wp_sfwaiting WHERE topic_id = XXXXX;
DELETE FROM wp_sfuseractivity WHERE type_id=1 AND item_id = XXXXX;
DELETE FROM wp_sfuseractivity WHERE type_id=6 AND item_id = XXXXX;
DELETE FROM wp_sfuseractivity WHERE type_id=5 AND meta_id = XXXXX;

IF you do NOT use the blog linking plugin then remove the 'sflinks' query.
IF you do NOT use the tags plugin the remove the 'sftagmeta' query.
IF you do NOT use the watch plugin then remove the 'sfuseractivity' query where type_id=1.
IF you do not use the post rating plugin then remove the 'sfuseractivity' query where type_id=5.
IF you do NOT user the subscriptions plugin then remove the 'sfuseractivity' query where type_id=6 AND the 'sfdigest' query.

Replace the table prefix 'wp_' if this is not what you use.

Replace the XXXXX with the topic ID you wish to remove - in each query.

As always we recommend a full database backup be made prior to using these queries. And, I am afraid, as always we offer these queries with no guarantee of success or effect.

andy-signature.png
YELLOW
SWORDFISH
Avatar
Tal
Member
Free Members
sp_UserOfflineSmall Offline
Apr 2, 2015 - 10:46 am

That appears to have allowed me to delete the topics in question. I don't supposed there's a way to update the forum stats though is there? Running the stats update cron doesn't do it

Avatar
Yellow Swordfish
Glinton, England
SP Master
sp_UserOfflineSmall Offline
Apr 2, 2015 - 12:35 pm

Ah I knew there would be something±

In the sfforums table is a column called 'topic_count' and another called 'post_count' which wont get adjusted. In many respects this is, of course, not perfect db management but it actually makes such a huge difference to overall performance that having these value is worthwhile.

We will need another couple of queries to update these values at the end of the deletes,

andy-signature.png
YELLOW
SWORDFISH
Avatar
Tal
Member
Free Members
sp_UserOfflineSmall Offline
Apr 2, 2015 - 11:35 pm

Users are reporting that forum posting is going a little faster now so I'm hoping this has all been worthwhile even if the stats are no longer accurate :)

Avatar
Yellow Swordfish
Glinton, England
SP Master
sp_UserOfflineSmall Offline
Apr 3, 2015 - 3:19 am

Go to the forum admin > toolbox > housekeeping and run the 'Rebuild Forum Indexes' against the forum that had the topic(s) manually removed. That should repair the stats count data which should then correct themselves when the stats Cron action is performed.

andy-signature.png
YELLOW
SWORDFISH
Avatar
Tal
Member
Free Members
sp_UserOfflineSmall Offline
Apr 4, 2015 - 2:33 am

Yellow Swordfish said
Go to the forum admin > toolbox > housekeeping and run the 'Rebuild Forum Indexes' against the forum that had the topic(s) manually removed. That should repair the stats count data which should then correct themselves when the stats Cron action is performed.

I already tried that but I just get an endless "Please wait..."

Avatar
Yellow Swordfish
Glinton, England
SP Master
sp_UserOfflineSmall Offline
Apr 4, 2015 - 3:10 am

Yes - I can see even that might take a very long time..
Let's try this instead...

Open the forum in question so you see the list of topics (forum view). Select a topic with a small number of posts and click on the forum tools, Select the 'View Properties' option and then click on the 'verify' button.

Does that work it out?

andy-signature.png
YELLOW
SWORDFISH
Avatar
Tal
Member
Free Members
sp_UserOfflineSmall Offline
Apr 6, 2015 - 9:31 am

View properties ran on one of the smaller topics but it made no difference to the post count.

I left the Rebuild Index thing running for a couple of hours.. it didn't seem like it was really doing anything

Avatar
Yellow Swordfish
Glinton, England
SP Master
sp_UserOfflineSmall Offline
Apr 6, 2015 - 12:33 pm

It made no difference? Even after the stats cron task has run again?

andy-signature.png
YELLOW
SWORDFISH
Forum Timezone: Europe/Stockholm
Most Users Ever Online: 1170
Currently Online:
Guest(s) 1
Currently Browsing this Page:
1 Guest(s)
Top Posters:
Mr Papa: 19448
Ike: 2086
Brandon: 864
kvr28: 804
jim: 650
FidoSysop: 577
Conrad_Farlow: 531
fiddlerman: 358
Stefano Prete: 325
Member Stats:
Guest Posters: 619
Members: 17363
Moderators: 0
Admins: 4
Forum Stats:
Groups: 7
Forums: 17
Topics: 10127
Posts: 79625