Deleting old expired jobs

Note: All code examples on this site are provided for developer reference/guidance only and we cannot guarantee that they will always work as expected. Our support policy does not include assistance with modifying or debugging code from any code examples, and they may be changed or removed if we find they no longer work due to changes in our plugins.

Unlike old ‘previews’, expired jobs are not deleted by default. But you can enable this functionality using a quick snippet in your theme’s functions.php file (or using a functionality plugin):

If enabled, expired job listings will be deleted after “job_manager_delete_expired_jobs_days” days which defaults to 30. Cleanup will be done daily via a cron job.