Skip Navigation

[Resolved] Automatic post expiration permenently in Toolset forms

This thread is resolved. Here is a description of the problem and solution.

Problem:

I have Membership Website of Expert Witnesses and they are adaments that they want the post removed from the WordPress Database after this 14 days. I've read that WordPress automatically keeps items in the Trash for 30 days then removes them entirely from the system. Is there a way with Toolset to have these posts removed entirely from the WordPress Databased when they are set to expire?

Solution:

There isn't such a built-in feature with Toolset, you might consider custom codes, for example:

https://toolset.com/forums/topic/automatic-post-expiration-permenently-in-toolset-forms/#post-1215293

Relevant Documentation:

This support ticket is created 5 years, 9 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Hong_Kong (GMT+08:00)

This topic contains 2 replies, has 2 voices.

Last updated by Ronald E 5 years, 9 months ago.

Assisted by: Luo Yang.

Author
Posts
#1215210

I have a content form set to automatically expire a post after 14 days and it's set to move to trash.

I have Membership Website of Expert Witnesses and they are adaments that they want the post removed from the WordPress Database after this 14 days. I've read that WordPress automatically keeps items in the Trash for 30 days then removes them entirely from the system. Is there a way with Toolset to have these posts removed entirely from the WordPress Databased when they are set to expire?

My clients do not want any records of there comments to be reclaimed by court orders which is happens with expert witnesses.

#1215293

Hello,

No there isn't such a built-in feature with Toolset, you might consider custom codes, for example use action hook wp_trash_post to delete the post from database.

More help:
https://developer.wordpress.org/reference/hooks/wp_trash_post/
https://developer.wordpress.org/reference/functions/wp_delete_post/

#1215527

My issue is resolved now. Thank you!