How to Remove Query Strings from Your WordPress Site

How to Remove Query Strings from Your WordPress Site

wprocket

Add this snippet to functions.php

<?php
// Do NOT include the opening PHP tag

// Remove Query Strings
function _remove_script_version( $src ){

    $parts = explode( '?ver', $src );

        return $parts[0];
    
}

add_filter( 'script_loader_src', '_remove_script_version', 15, 1 );
add_filter( 'style_loader_src', '_remove_script_version', 15, 1 );

 

GenesisPro728x90

Facebook
Twitter
LinkedIn
Pinterest
Tumblr
Anwer Ashif

Anwer Ashif

Founder of RainaStudio. Help businesses and individuals to create and outstand their online presence. Our success rate is measurable. Our blog served all around the world and counting.

Leave a Reply

Your email address will not be published. Required fields are marked *