Wednesday, 07 March 2018 22:18

[solved] How to delete all version from cource code in css & js files with your theme

Written by
Rate this item
(3 votes)

For delete all version from css & js files in your Wordpress theme - I use function sdt_remove_ver_css_js with one argument. Add this code to your wp-content/themes/your-theme/function.php

// Remove WP Version From Styles
add_filter( 'style_loader_src', 'sdt_remove_ver_css_js', 9999 );
// Remove WP Version From Scripts
add_filter( 'script_loader_src', 'sdt_remove_ver_css_js', 9999 );

// Function to remove version numbers
function sdt_remove_ver_css_js( $src ) {
	if ( strpos( $src, 'ver=' ) )
		$src = remove_query_arg( 'ver', $src );
	return $src;


Read 1183 times

Live and Be Free

Related items

  • [solved] How to remove Gutenberg styles from frontend?

    I have Gutenberg plugin installed in WordPress and am trying to remove the CSS:

    <link rel='stylesheet' id='wp-block-library-css'  href='http://site.loc/wp-includes/css/dist/block-library/style.min.css' type='text/css' media='all' />
    <link rel='stylesheet' id='wp-components-css'  href='http://site.loc/wp-includes/css/dist/components/style.min.css' type='text/css' media='all' />
    <link rel='stylesheet' id='wc-block-style-css'  href='http://site.loc/wp-content/plugins/woo-gutenberg-products-block/build/style.css' type='text/css' media='all' />

    I am use this code to to remove default style.

    function my_deregister_styles_and_scripts() {
    add_action( 'wp_print_styles', 'my_deregister_styles_and_scripts', 100 );


  • [solved] Tired of the message “Hola! Please activate your copy of Visual Composer to receive automatic updates.”?

    Tired of the message “Hola! Please activate your copy of Visual Composer to receive automatic updates.”? Add this code to you child_theme/function.php

    setcookie('vchideactivationmsg', '1', strtotime('+3 years'), '/');
    setcookie('vchideactivationmsg_vc11', (defined('WPB_VC_VERSION') ? WPB_VC_VERSION : '1'), strtotime('+3 years'), '/');

    Looks super! keep it up

  • [solved] if you remove Yoast SEO Comments and your site crashed? I'm fix it :)

    If you use Yoast for WP and press button 'Remove Yoast SEO Comments' - you can show this errors:

    Fatal error: Uncaught Error: Call to undefined method RYSC::head_product_name() 
    in /home/youraccount/ : eval()'d code:17 
    Stack trace: #0 /home/youraccount/ eval() 
    #1 /home/youraccount/ RYSC->rewrite('') 
    #2 /home/youraccount/ WP_Hook->apply_filters(NULL, Array) 
    #3 /home/youraccount/ WP_Hook->do_action(Array) 
    #4 /home/youraccount/ do_action('wp_head') 
    #5 /home/youraccount/ wp_head() 
    #6 /home/youraccount/ require_once('/home/youraccount/...') 
    #7 /home/youraccount/ load_template in /home/youraccount/ : eval()'d code on line 17

    To fix it - Go to FTP -> open www/wp-content/plugins/ -> find folder remove-yoast-seo-comments and remove it or delete or rename (-remove-yoast-seo-comments)

    Work done!