The closest to what you want is the wp cache flush
CLI command, or wp_cache_flush()
which will flush any object caches, but these only flush persistent object caches implemented via WP_Cache
.
In particular:
- this only applies to object caches. If you do not have a persistent object cache then it will have no effect
- CDN caches and software such as Varnish caches can’t be flushed this way
- Page caching plugins that use the disk can’t be flushed this way
- caching plugins won’t support it, each plugin requires a unique solution
- transients and other caches in the database will be unaffected
- caches used by plugins that don’t use the object cache will be uneffected
wp cache flush
flushes the entire object cache, not a specific page or post/meta
So for anything that isn’t the persistent object cache, you’re out of luck, and will need to investigate the specific solutions you have chosen for your site. No generic WordPress solution exists