Fix for WP SUPER CACHE home not refreshing

WP SUPER CACHE is one of the most used WordPress plugin for cache, but probably there is a small bug…

December 1, 2014

WP SUPER CACHE is one of the most used WordPress plugin for cache, but probably there is a small bug in WP Super Cache homepage refresh configuration. This can explain why so many times I received alerts from clients that can’t find their posts in homepage! So I’ve found/modified/made this few lines of code to force refresh of the homepage. You can simply made a cronjob that calls a php file that remove index.* files from super cache directory, or you can write a wordpress action called with wp cron and delete hourly the same files.

Be sure that the directory of your cache is /wp-content/cache/supercache/

function delete_home_cache_hourly_function(){
	$dir = $_SERVER['DOCUMENT_ROOT']."/wp-content/cache/supercache/".$_SERVER['HTTP_HOST']."/";
	$file = "index.html";
function delete_home_cache_hourly(){
		wp_schedule_event (time(), 'hourly', 'delete_home_cache_hourly_job');


I'm a software engineer, an everyday web developer and a maker. I usually build sites with PHP, within or without WordPress. I build Internet of Things with Arduino and ESP8266. I'm the founder of and and I'm actually the Chief Technical Officer of Better Days web agency.


Optimize WordPress, a long list of tips

In the above image you can see your WordPress before reading this post, and after the optimizations you will make…

September 15, 2015

How to add rel=”nofollow” to links with preg_replace()

Adding rel="nofollow" to external link is a good SEO practice.

September 22, 2015

Social buttons: the fastest way for WordPress, without plugins

NOTE: the code in this post is written for WordPress but you can easily translate it in any language. You’re here…

September 15, 2015

Limit the number of categories for posts in WordPress

CHOOSE ONLY ONE CATEGORY WORDPRESS If you need to limit the number of categories used by the authors of your…

September 14, 2015

Remove archive pages in WordPress, how to

I think that in most blogs (that is not all) archive pages are redundant content and there’s no need to…

September 8, 2015

WordPress anyone can register, but no email confirmation

Many times it has happened to me that my WordPress installation properly send emails using wp_mail directly, specifing also the…

August 25, 2015