I want to update all posts with status from published to trashed or delete permanently. whose published date is 2018 and previous using WordPress cronjob.
Example: If I have 209085 posts, 500 posts can be trashed or delete permanently during each cronjob run.