Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Trigger Varnish cache purge on deploy to WP Engine
add_action( 'init', function(){
// Replace '901bcc678021c0e12f1583085cafda1d' with a secret of your own.
if ( ! empty( $_GET['purge-cache'] ) && '901bcc678021c0e12f1583085cafda1d' === $_GET['purge-cache'] ) {
echo 'Cache purged';
Copy link

musa-pro commented Mar 14, 2016

Didn't work for me. Could you recheck?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment