0

Hi!
I'd like to make this mysql command into a script and run it as a cron:

DELETE FROM xx_posts WHERE post_content=''

However, I don't know how. So the question is what should the php file look like to access and delete the empty wordpress posts from the database?
Thank you!

2
Contributors
2
Replies
3
Views
6 Years
Discussion Span
Last Post by wattaman
0

Ok,

//php file to run as cron

...db connection details...

$r = mysql_query("DELETE FROM xx_posts WHERE post_content=''");

//you could include some error or event logging too if you wanted

You should be able to set up a cronjob via cPanel or its equivalent. If you don't seem to have this facility talk to your host.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.