How do I remove the revolution slider query strings?

sample
?version=5.4.8

/wp-content/plugins/revslider/public/assets/fonts/revicons/revicons.woff?5510888
/wp-content/plugins/revslider/public/assets/js/extensions/revolution.extension.layeranimation.min.js?version=5.4.8
/wp-content/plugins/revslider/public/assets/js/extensions/revolution.extension.navigation.min.js?version=5.4.8
/wp-content/plugins/revslider/public/assets/js/extensions/revolution.extension.parallax.min.js?version=5.4.8
/wp-content/plugins/revslider/public/assets/js/extensions/revolution.extension.slideanims.min.js?version=5.4.8

Hi There,

You have to setup the X child theme first: https://theme.co/apex/forum/t/setup-how-to-setup-child-themes/57.

After that add the following code under functions.php file locates in your child theme:

function remove_css_js_ver( $src ) {
	if( strpos( $src, '?version=' ) ) $src = remove_query_arg( 'version', $src );
	return $src;
}
add_filter( 'style_loader_src', 'remove_css_js_ver' );
add_filter( 'script_loader_src', 'remove_css_js_ver' ); 

Hope it helps :slight_smile:

It did not work. :frowning:

Hi,

You can try this code instead.

add_filter( 'style_loader_src', 'remove_css_js_ver' );
add_filter( 'script_loader_src', 'remove_css_js_ver' );

function remove_css_js_ver( $url )
{
if( strpos( $url, 'revslider' ) ) {
    $url =  remove_query_arg( 'ver', $url );
}
return $url;
}

Hope that helps

removing other query string. but the revolution slider does not remove the query string. I do not understand why.

Hi there,

Are the resources that you have included on your initial post loading on the homepage? I tried checking the JS and CSS files that get loaded on the homepage, and the query strings are remove already.

If case this is happening to a specific page, please provide the direct link to the page so that we can check it.

Thank you.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.