How to auto rename JS files to prevent browser cache issues

The function wp_enqueue_script takes a parameter $ver that you can use to automatically add an version parameter to the URL. To always load the newest version of your Javascript-File, you can use the php filemtime-function to give the timestamp of the modification date.

In a Plugin, use like this:

wp_register_script( 'my-awesome-script', plugin_dir_url( __FILE__ ). 'assets/my-awesome-script.js', array(), filemtime( plugin_dir_path( __FILE__ ). 'assets/my-awesome-script.js' ), true );

Happy Coding!

deneme bonusu veren sitelerbahis casinomakrobetceltabetpinbahispolobetpolobet girişpinbahis girişmakrobet girişpulibet girişmobilbahis girişkolaybet giriş