Support

Account

Home Forums General Issues chage post status when input date equal today Reply To: chage post status when input date equal today

  • Adding a CRON in WP would take a while to explain and beyond what I can help you with here.

    But in order to change the status of a post based on a field you need to do a query to get every post that is published. Then you need to loop over all the posts and get the ACF field. Then you need to compare the value of the field with the current date and if it is older then you alter the post status.

    Here are some examples of similar crons https://wordpress.stackexchange.com/questions/213720/cron-job-to-auto-delete-posts-of-a-specific-post-type-older-than-x-days

    https://wordpress.stackexchange.com/questions/124875/set-post-to-draft-after-set-period-based-on-post-modified-date

    https://wordpress.stackexchange.com/questions/305567/1-day-after-custom-date-change-post-status-to-draft