Tagged Questions
1
vote
1answer
435 views
Delete posts from a post type automatically via Cron
how can I use Cron to delete posts of a certain post type once they reach a certain limit, like keep maximum 50 posts?
The reason is that these posts are being imported automatically periodically, so ...
2
votes
2answers
466 views
Use Cron to modify posts via sql
Hi to all I need to run this twice a day:
UPDATE wp_posts SET post_content = REPLACE ( post_content, '[img]', '<img src="' );
UPDATE wp_posts SET post_content = REPLACE ( post_content, '[IMG]', ...
1
vote
1answer
2k views
Create cron job without a plugin?
Basically I wrote a function that lets me change the post status to draft depending of a field in the postmeta table:
/**
* Remove ads if they have been sold for over 5 days
*/
function ...