| 开发者 | butialabs |
|---|---|
| 更新时间 | 2026年10月30日 02:59 |
| PHP版本: | 8.1 及以上 |
| WordPress版本: | 7.1 |
| 版权: | GPLv3 or later |
| 版权网址: | 版权信息 |
wp-config.php:
define( 'CLASSICFLARE_CF_API_TOKEN', 'your-token' );
or set CLASSICFLARE_CF_API_TOKEN in the environment. The token is then never written to the
database, so it stays out of backups and staging copies, and the settings screen stops offering
a field for it. CLASSICFLARE_CF_ZONE_ID does the same for the zone, skipping discovery.
CLASSICFLARE_DISABLE set to true switches automatic purging off, for a staging copy that shares
the production token.Yes. It is written for ClassicPress 2 and needs nothing from the block editor. On WordPress it also catches block editor saves, after categories and tags have been written.
The Global API Key can do anything to every zone in your account and cannot be limited. A token can be limited to purging the cache of one zone, and revoked on its own.
Comments posted from the front end are purged a few seconds later, on WP-Cron, so the visitor
does not wait on a call to Cloudflare. If your site sets DISABLE_WP_CRON, make sure a system cron
calls wp cron event run --due-now every minute.
The hostname in your site address is not proxied by Cloudflare (grey cloud), or belongs to another zone. Those URLs are reported as skipped, not failed, and are not retried.
wp classicflare purge <url>...wp classicflare post <id> [--dry-run]wp classicflare purge-all [--yes]wp classicflare connect [<token>]wp classicflare testwp classicflare statusYes, through functions or actions that do nothing if ClassicFlare is not installed:
do_action( 'classicflare_purge_url', [ 'https://example.com/page/' ] );
do_action( 'classicflare_purge_post', $post_id );
do_action( 'classicflare_purge_all' );
The classicflare_purge_urls filter adjusts the final list before it is sent, and
classicflare_sitemap_urls teaches it about a sitemap generator it does not know.