| 开发者 | simpliplugin |
|---|---|
| 更新时间 | 2026年11月12日 00:44 |
| PHP版本: | 7.4 及以上 |
| WordPress版本: | 7.1 |
| 版权: | GPLv2 or later |
| 版权网址: | 版权信息 |
ver query parameter that WordPress commonly adds to enqueued CSS and JavaScript URLs. With a single setting, you can remove that parameter from public-facing asset URLs while keeping all other URL parameters intact.
WordPress uses version query strings to help browsers recognize updated files. Some site configurations prefer URLs without the ver parameter, for example when using a specific legacy proxy or caching setup. This plugin offers that choice without changing physical files or requiring edits to a theme.
What the plugin changes
An enqueued asset URL may look like this:
https://example.com/wp-content/themes/example/style.css?ver=1.2.3
When the plugin is enabled, the filtered URL becomes:
https://example.com/wp-content/themes/example/style.css
If an asset has other query parameters, such as ?theme=dark&ver=1.2.3, the plugin removes ver and leaves theme=dark in place. It does not remove query parameters with other names.
Key features
ver query argument from enqueued script and stylesheet URLs on the public site.remove_query_arg() to remove only the ver argument. Regular WordPress dashboard pages are not altered. WordPress AJAX requests can still run URL filters, depending on their context.
No theme modification or rewrite-rule configuration is required. The plugin's Settings page provides a checkbox to turn this behavior on or off.
Developer hooks
For custom integrations, these hooks are available:
simpli_asset_version_killer_excluded_handles: Filter the list of handles excluded from cleanup. Receives the excluded-handles array, current handle, and URL.simpli_asset_version_killer_cleaned_src: Filter an asset URL after ver has been removed. Receives the cleaned URL, original URL, and handle.simpli_asset_version_killer_prevent: Override the enabled state for a request. Return true to force cleanup, false to prevent it, or null to use the saved setting.simpli-asset-version-killer folder into the /wp-content/plugins/ directory, or install the plugin through the WordPress Plugins screen.Only the parameter named ver is removed. Other query parameters are preserved.
No. Only filtered asset and resource URLs are changed. The plugin does not edit, minify, concatenate, or regenerate your source files.
Yes. Go to Settings > Asset Version Killer to turn cleanup on or off. The plugin is enabled by default after activation.
Ordinary WordPress admin pages are excluded from URL cleanup. Requests handled through WordPress AJAX may be treated differently because the code allows processing during AJAX requests.
Yes. Developers can add handles to the simpli_asset_version_killer_excluded_handles filter to skip particular assets.
No. Modern caches usually handle query-string URLs. This plugin is intended for sites with a specific reason to remove the parameter, not as a guaranteed speed optimization.
The version string is part of WordPress's cache-busting behavior. If you remove it, previously cached assets might remain in use. Purge your browser, page, or CDN cache as appropriate.
Deactivation stops the plugin from filtering URLs. Uninstallation removes the plugin's saved enable/disable option.