Forums

[resolved] remove ?ver= from header (4 posts)

  1. blueyez
    Member
    Posted 1 year ago #

    hi. how can i remove the

    /wp-content/gd-star-rating/css/rating.css?ver=1.9.0

    from the plugins ( css/js )
    the cache don't work for those

  2. Hax
    Member
    Posted 1 year ago #

    This should work.

    Add this code to your function.php in your theme's folder

    ## remove version from css and js for proper caching
    function _remove_script_version( $src ){
    	$parts = explode( '?', $src );
    	return $parts[0];
    }
    add_filter( 'script_loader_src', '_remove_script_version', 15, 1 );
  3. blueyez
    Member
    Posted 1 year ago #

    worked except for one:

    /wp-content/plugins/sexybookmarks/css/style.css?ver=3.2.3.1

  4. Hax
    Member
    Posted 1 year ago #

    you can always hard code this url into your theme but you may have issues updating your plugin

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags