php - Update all posts automatically within a 1hour interval
Get the solution ↓↓↓I want to create a script that updates all of my published WP posts (including CPTs) automatically every hour.
I tried searching and didn't find any results about that.
Any ideas?
Thank in advance!
Answer
Solution:
Your question lack details, e.g. what data exactly you want to update.
However, you can use the WordPress REST API with the/posts
endpoint:
POST /wp/v2/posts/<id>
https://developer.wordpress.org/rest-api/reference/posts/#update-a-post
(If you want to update a lot of posts, it should be done via batch request - meaning 1 request instead of x.)
Furthermore, you would need to execute a (real) hourly cron job that calls your script, but this is a whole other topic and there are a lot of howto articles in the internet.
Share solution ↓
Additional Information:
Link To Answer People are also looking for solutions of the problem: too few arguments to function laravel
Didn't find the answer?
Our community is visited by hundreds of web development professionals every day. Ask your question and get a quick answer for free.
Similar questions
Find the answer in similar questions on our website.
Write quick answer
Do you know the answer to this question? Write a quick response to it. With your help, we will make our community stronger.