RS Head Cleaner Plus
[resolved] Next release to include Remove Version from CSS (4 posts)

  1. Jason Wong
    Posted 2 years ago #

    G'day Scott,

    I noticed that your plugin could include another feature to the remove WP versions from all CSS headers. At this moment, I'd to add the following code into the active theme's functions.php

    // Remove WP version param from any enqueued scripts
    function vc_remove_wp_ver_css_js( $src ) {
    	if ( strpos( $src, 'ver=' ) )
    		$src = remove_query_arg( 'ver', $src );
    	return $src;
    add_filter( 'style_loader_src', 'vc_remove_wp_ver_css_js', 9999 );
    add_filter( 'script_loader_src', 'vc_remove_wp_ver_css_js', 9999 );

    This will beef-up your plugin :)



  2. Red Sand Media Group
    Plugin Author

    Posted 2 years ago #

    Hi Jason,

    Good call. I had noticed that the versions added to the CSS keeps it from validating.

    Let me just check into it and double-check that it won't affect any WP functionality, and I'll be happy to add that to the next version. That would be great to remove the WP ver number form there too. WP's default setup seems like it would slow down a page at least a little because it won't let the browser use cached versions of the css as it stands.

    Thanks for sharing your code! It should provide both security and speed improvements.

    - Scott

  3. Red Sand Media Group
    Plugin Author

    Posted 2 years ago #

    Hey Jason,

    I just released the new version with this implemented. Thanks again for the suggestion. :)

  4. Jason Wong
    Posted 2 years ago #

    You're welcome, Scott.

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • RS Head Cleaner Plus
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic