Storing in bin ....

2 views
Skip to first unread message

John Logsdon

unread,
Feb 12, 2012, 2:56:32 AM2/12/12
to Manchester WordPress User Group
hi Group

Sorry I won't be able to join you next week but can I ask a question instead!

One of my users started storing posts she didn't want to be revealed for a bit
in the bin - ie post_type='trash'. (This wasn't my suggestion - I just
schedule such things for 2099.,,,,)

Yesterday a lot of them disappeared and she emailed me in a panic.

I can restore them from the rsnapshot backups taken every night
of /var/lib/mysql (remember to change the file:group ownership if you do
this) but the question is - is there any automatic garbage collection and
deletion of trashed posts?

I can't see any in the documentation and there is no garbage collection plugin
on the website. So I am left wondering how they all disappeared....
--
Best wishes

John Logsdon

Chris Witham

unread,
Feb 12, 2012, 4:14:03 AM2/12/12
to manchester-word...@googlegroups.com
Hi John

I think you need to change the empty trash value in WP-config. It defaults to 30 days. 


Add this to your wp-config file and set it to something really high if you don't want trash to be emptied. 

define('EMPTY_TRASH_DAYS', 30 );  // 30 days
I think there are better ways to achieve what your client wants. Like saving posts as drafts rather than published and using the preview to see how they'll look after publishing. Alternatively set the content to private so only logged in users see it on the front end. Then when the content should be revealed the private setting can just be turned off. Scheduling posts would automatically move them from draft to published at the required date. 

Hope this helps 

Chris
--
See the group blog at http://mwug.info

You received this message because you are subscribed to the Google
Groups "Manchester WordPress User Group" group.
To post to this group, send email to
manchester-word...@googlegroups.com
To unsubscribe from this group, send email to
manchester-wordpress-...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/manchester-wordpress-user-group

John Logsdon

unread,
Feb 12, 2012, 4:32:21 AM2/12/12
to manchester-word...@googlegroups.com
Chris

Many thanks for this! At least there is a rational explanation.

I did suggest scheduling but drafts or private is another idea.

I have updated the posts and postmeta tables from my backups and added a 40
day trash limit while my friend is correcting or publishing. Then I will
revert it.

Reply all
Reply to author
Forward
0 new messages