I have many posts (about 1,000) where each contains a custom field with a value. I need to update these values periodically, hopefully at least once per day, from an external API.

What is a recommended way to go about this without getting timeouts and using the most efficient means possible?


I suggest using a WordPress cron job, in the form of a real server cron job (by default WordPress cronjobs are executed when a user visits the website).

Setting up a cron job (the easy way): https://kinsta.com/knowledgebase/wordpress-cron-job/

Real cronjob via server crontab: https://easyengine.io/tutorials/wordpress/wp-cron-crontab/

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.