Delete WordPress feed cache hourly with a custom function

A few days back, Frank from WPEngineer wrote a nice piece of SQL to delete WordPress feed caches. I love automating WordPress to do common tasks for me, especially boring repetitive tasks like database maintenance, so I’ve added to his code to automate the process.

Now, whenever WordPress loads a fresh page, it will also include this simple function which checks to see if it’s recently run (3600 is an hour, you can change it to run more often or less often by changing this number to the minimum seconds between checks) and if not, it runs a simple SQL query to delete the cache records.

Simply include the above code in your functions.php file to make it work or you can download the plugin from GitHub.

About Christopher Ross

I build WordPress website in Toronto, Canada for passionate companies who need amazing solutions. You can find me on Linkedin, Facebook, Twitter, and WordPress. If you'd like help with your next website, send me an email.

One thought on “Delete WordPress feed cache hourly with a custom function

  1. Zearfoss Goodwin

    Wow, awesome weblog format! How long have you been blogging for? you made blogging look easy. The entire glance of your web site is wonderful, as neatly as the content!

    Reply