Add File Version (AFV) can automatically or manually add file version to the CSS/JS files that were added using wp_enqueue_style and wp_enqueue_script, admin_enqueue_style and admin_enqueue_script.
The AUTO mode adds file version based on PHP file modification time, while the MANUAL mode adds version based on your input to the target files (CSS/JS).
Installation method 1 (easy way)
- Go to WordPress dashboard
- Click on Plugins > Add Plugin
- Search for Add File Version (AFV)
- Then click on Install, then click 'Activate Now'
Installation method 2 (manual)
- Go to WordPress dashboard
- Click on Plugins > Add Plugin
- Search for Add File Version (AFV)
- Click 'Upload Plugin' button
- Upload 'add-file-version.zip'
- Activate the plugin
Installation method 3 (manual)
- Upload 'add-file-version.zip' to the '/wp-content/plugins/' directory
- Extract the 'add-file-version.zip' archive into the '/wp-content/plugins/' directory
- Activate the plugin through the 'Plugins' menu in WordPress
Usage
Install the 'Add File Version (AFV)' plugin and activate it. Upon activation, AFV by default will add version in AUTO mode to ALL CSS and JS files added using wp_enqueue_style and wp_enqueue_script, admin_enqueue_style and admin_enqueue_script. The plugin provides a page where you can change and alter its settings. It can be found at the WordPress dashboard > Tools > Add File Version.
There are 2 modes available, AUTO and MANUAL. The AUTO mode adds file version based on PHP file modification time, while the MANUAL mode adds version based on your input to the target files (CSS/JS). Each versioning mode allows you to select files to add version. It can be ALL, CSS only or JS only. To disable the versioning function of the plugin, just uncheck both modes and save the changes by clicking the button at the bottom.