Support » Requests and Feedback » wp_delete_post() enhancement request

  • In the process of doing some basic remote data collection via online user entered forms … the form plugin provider is offering a builtin GDPR feature which is great but they choose to use WP’s builtin wp_delete_post() routine to provide this feature. Deleting POST, while being a cheap and dirty way to provide GDPR, leaves absolutely no trace of transactions and therefore no way to verify all data was captured.

    Without getting in to design decisions, and the understanding that if a function exists, it will be used. As such, could WP possibly add an option to their builtin wp_delete_post(int $postid, bool $force_delete = false , optional bool $retain_audit_details) function where: Date, Time, and Post_ID are NOT deleted … this minimal information is invaluable for auditing transactions especially to ensure no transactions are mia

    The plugin provider showed no interest in changing their GDPR logic so basically decided to switch off their GDPR feature and write a custom GDPR in php … with WP, the hope was to be able to go code free, the reality is, we have had to pay for plugins PLUS create 1000+ lines of custom php and java code.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Moderator bcworkz


    It doesn’t make sense to me to use wp_delete_post() if we are going to retain certain data. wp_delete_post() essentially does a DROP query, removing everything. To retain certain data, we would need to do an UPDATE query. I think the sort of data removal you propose begs for a new function, such as gdpr_clean() or something.

    I don’t disagree something like what you propose would be useful, I just question if tacking onto wp_delete_post() is the best approach. I can see how in a macro sense it seems logical, but because of the way the function actually works, we’d end up writing an unrelated code section just to handle GDPR removals. That code section may as well be its own function IMO.

    Point taken … a new WP function … NOT a wp_delete_post() enhancement

    This new function would need to: delete all associated media files and delete all records with the exception of any audit related records (retaining: post_date, post_time and post_id)

Viewing 2 replies - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.