Is there any way to update post meta value each day (daily automaticaly) ?

For example my event has started each day at 10pm my current post meta is: 2015-01-01 10:00 next day i should change it to 2015-01-02 10:00 and again next day to 2015-01-03 10:00

Is there any way to update it automaticaly ?! if yes how is there any function daily ?

Thank you

  • 1
    If it's daily, why not just store the time? – birgire Sep 5 '15 at 10:51

In general WordPress posts do not represent continuous process. They and their data capture the state of certain point in time (last edit).

While there is a WP Cron mechanism for scheduled and (optionally) recurrent operations, it's poorly suited for periodic post manipulation. For a large amounts of posts it would take either excessively long running update routines, or excessive amount of short running but multiple events firing. Either has issues.

In a nutshell I would suggest instead of looking how to do this, you should look how not to. As comment suggests there might be easier to change what data precisely you store and work with it, than make recurrent changes to it.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.