• Resolved russromei

    (@russromei)


    I have a very dynamic site listing tens of thousands of products, most of which I expire in 30 days.

    Is there a way for the complted and failed items to self delete? (after a given time if need be)

    It is getting tedious cleaning then manually daily

Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Support Riza Maulana Ardiyanto

    (@rizaardiyanto)

    Hi @russromei

    Thanks for using PublishPress Future.

    Are you expecting auto delete for the log on Future Action menu?

    Thread Starter russromei

    (@russromei)

    Yes, the logs, hoping to auto delete completed and failed

    Plugin Support Riza Maulana Ardiyanto

    (@rizaardiyanto)

    @russromei Could you please try this guide: https://publishpress.com/knowledge-base/future-action-logs-details/ ?

    Let me know if you have any issues.

    Thread Starter russromei

    (@russromei)

    Perfect, thank you!

    Thread Starter russromei

    (@russromei)

    As in the docs, where would I place this code?

    PublishPress Future will retain “completed” log items for 30 days. However, if you want to shorten this time, you can use the following filter. This code below will change the retention time to one week. 604800 is the value for one week in seconds. If you want to delete the logs every three days, you can change it to 259200.

    add_filter( 'action_scheduler_retention_period', 'ppf_delete_logs' );
    /**
     * Change Action Scheduler default purge to 1 week
     */
    function ppf_delete_logs() {
     return 604800;
    }

    Plugin Support Riza Maulana Ardiyanto

    (@rizaardiyanto)

    You could apply it on your theme file function.php or using some code snippet plugin.

    Thread Starter russromei

    (@russromei)

    OK, potential problem?

    If the function uses the table prefix, it won’t work for me

    I actually have 2 sets of tables (one empty) with different prefixes, neither of which you use in your docs “wp_”

    • This reply was modified 1 year, 7 months ago by russromei.
    Plugin Support Riza Maulana Ardiyanto

    (@rizaardiyanto)

    @russromei So you try to delete manually from the database? Then yes, you should adjust the table prefix. Our example is to use the default wp prefix. If you use another, then you should adjust the SQL command.

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Delete Future Actions Items’ is closed to new replies.