How To Remove Script Version Numbers

function ocean_remove_script_version( $src ) {
	if ( strpos( $src, 'ver=' ) ) {
		$src = remove_query_arg( 'ver', $src );
	}
	return $src;
}
add_filter( 'script_loader_src', 'ocean_remove_script_version', 15, 1 );
add_filter( 'style_loader_src', 'ocean_remove_script_version', 15, 1 );

All PHP snippets should be added via a child theme's functions.php file.

Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.