How can I auto expire published post in a specific category. I have a category called sponsored but I want each article published in this category to auto expire (revert to draft or trash) after 30 days. A 30 day expiry time stamp will be applied immediately to every post published into the sponsored category. Please I don’t mean that all post in the sponsored category should expire at the same time, because the post are being published at different times, so the time stamp is applied per post.
Thank you for posting. It can be doable using the WordPress Cron features. You can check the documentation here.
All you need to do is
Step 1: Setup a cron job which runs daily one time.
Step 2: With callback function get all the posts form your categories whose published date is older than 30 days.
Step 3: Update post status
Or check this plugin
- This reply was modified 1 year ago by Ravi.
You must be logged in to reply to this topic.