Skip to content

Instantly share code, notes, and snippets.

View rmens's full-sized avatar

Raymon Mens rmens

  • Rotterdam, the Netherlands
  • 20:51 (UTC +01:00)
View GitHub Profile
@rmens
rmens / cf-purge-wp.php
Last active December 22, 2024 17:55
Cloudflare cache purge WP
<?php
/**
* Plugin Name: Cloudflare Cache Purge Extended
* Description: Purges Cloudflare cache for the front page, specific post, wp-json routes, and general posts endpoint when a post is published, updated, scheduled, or trashed.
* Version: 1.1
* Author: Raymon Mens
*/
// Cloudflare settings
$cloudflare_zone_id = 'YOUR_ZONE_ID';