

The settings page: choose what to keep fresh, when to update versions (including automatically after plugin/theme/WordPress updates), whether to also clear the detected page cache, and whether browsers may keep static files for a year — with the header verification result right on the page.
You changed the site, but a client or visitor still sees the old version and you have to say “please clear your browser cache”? This plugin makes that conversation unnecessary.
Prevent Browser Caching makes sure browsers always load the current version of your site — without disabling browser caching and slowing the site down.
style.css?ver=4.9.6). Browsers cache the file until this parameter changes. In the recommended automatic mode the plugin sets the version from the file’s own modification time: browser caching works at full strength, and the moment you update a file every visitor gets the new one.wp pbc update, wp pbc status) and WordPress Abilities let deploy scripts and AI agents update versions safely.The recommended way to set the CSS/JS version from code is the pbc_assets_version filter. Add this to the functions.php file of your theme and change the value whenever you need to update assets:
add_filter( 'pbc_assets_version', function( $ver ) {
return '123';
} );
Because it uses WordPress’s own add_filter(), it keeps working safely even if the plugin is ever deactivated — your site won’t break.
Filters for fine-tuning:
pbc_skip_src( $skip, $src, $handle ) — return true to leave a given asset URL untouched.pbc_assets_version( $ver, $src, $handle ) — change the version applied to a given asset.pbc_purge_page_cache( $purge, $plugin_name ) — return false to prevent the page-cache purge on version updates.pbc_after_bump( $result ) — action fired after every version update, with the new timestamp and the purge outcome.pbc_cache_policy_rules( $rules, $options ) — change the generated long-caching rules before they are written to .htaccess (or shown as a snippet).pbc_after_auto_bump( $context ) — action fired after an automatic post-update refresh, with the update type and the purge outcome.PBC_DISABLE_HTACCESS_WRITE — define this constant as true (e.g. in wp-config.php) and the plugin will never write to .htaccess itself; the settings page shows the rules for manual setup instead.wp pbc update — updates the versions (and clears the detected page cache when the settings option is on). Add --skip-purge to leave the page cache alone for that run.wp pbc status — shows the mode, what is versioned, the last manual update and the detected page-cache plugin. Supports --format=table|json|yaml.On WordPress 6.9+ the plugin registers two Abilities, discoverable via the Abilities API, REST and the MCP adapter — so AI agents and site-management tools can operate the plugin without custom glue code:
prevent-browser-caching/bump-versions — update the versions; optional boolean input purge (set false to skip the page-cache purge).prevent-browser-caching/status — read-only report of the current configuration.Both require the manage_options capability.
Legacy: earlier versions documented a prevent_browser_caching() function instead. It still works exactly as before — it disables the plugin’s admin settings and gives you full control — but I recommend the filter above: a bare function call in functions.php triggers a fatal error if the plugin is ever deactivated. If you keep using the function, guard it:
if ( function_exists( 'prevent_browser_caching' ) ) {
prevent_browser_caching( array(
'assets_version' => '123'
) );
}
Many of the recent improvements started as reports and questions in the support forum — thank you to everyone who took the time to describe a problem or share an idea. If something doesn’t work as expected on your site, please open a topic there: it genuinely helps make the plugin better for everyone.