Remove query strings from static resources on Wordpress site
<p>I'm having difficulties with removing query strings from static resource on my Wordpress site. I've tried the common function.php code that seems to work for most but my Pingdom analysis isn't changing. </p>

<p>I have WordFence and Cache Enabler installed if that affects things.</p>

<p>Here's the code I'm using:</p>

<pre><code>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 ); 

remove_action( 'wp_head', 'print_emoji_detection_script', 7 ); 
remove_action( 'wp_print_styles', 'print_emoji_styles' ); 
</code></pre>

<p>I also have this in my .htaccess to help with caching:</p>

<pre><code>&lt;IfModule mod_expires.c&gt;
# Enable expirations
ExpiresActive On 

# Default directive
ExpiresDefault "access plus 1 month"

# favicon
ExpiresByType image/x-icon "access plus 1 year”

# images
ExpiresByType image/gif "access plus 1 month"
ExpiresByType image/png "access plus 1 month"
ExpiresByType image/jpg "access plus 1 month"
ExpiresByType image/jpeg "access plus 1 month"

# css
ExpiresByType text/css "access plus 1 week”

# javascript
ExpiresByType application/javascript "access plus 1 week"
&lt;/IfModule&gt;

&lt;ifModule mod_headers.c&gt;
  &lt;filesMatch ".(css|jpg|jpeg|png|gif|swf|svg|js|ico)$"&gt;
    Header set Cache-Control "max-age=2592000, public"
  &lt;/filesMatch&gt;
  &lt;filesMatch ".(x?html?|php)$"&gt;
    Header set Cache-Control "private, must-revalidate"
  &lt;/filesMatch&gt;
&lt;/ifModule&gt;

&lt;IfModule mod_deflate.c&gt;
  # Compress HTML, CSS, JavaScript, Text, XML and fonts
  AddOutputFilterByType DEFLATE application/javascript
  AddOutputFilterByType DEFLATE application/json
  AddOutputFilterByType DEFLATE application/atom+xml
  AddOutputFilterByType DEFLATE application/rdf+xml
  AddOutputFilterByType DEFLATE application/rss+xml
  AddOutputFilterByType DEFLATE application/vnd.ms-fontobject
  AddOutputFilterByType DEFLATE application/x-font
  AddOutputFilterByType DEFLATE application/x-font-opentype
  AddOutputFilterByType DEFLATE application/x-font-otf
  AddOutputFilterByType DEFLATE application/x-font-truetype
  AddOutputFilterByType DEFLATE application/x-font-ttf
  AddOutputFilterByType DEFLATE application/x-font-woff
  AddOutputFilterByType DEFLATE application/x-javascript
  AddOutputFilterByType DEFLATE application/xhtml+xml
  AddOutputFilterByType DEFLATE application/xml
  AddOutputFilterByType DEFLATE font/opentype
  AddOutputFilterByType DEFLATE font/otf
  AddOutputFilterByType DEFLATE font/truetype
  AddOutputFilterByType DEFLATE font/ttf
  AddOutputFilterByType DEFLATE image/svg+xml
  AddOutputFilterByType DEFLATE image/x-icon
  AddOutputFilterByType DEFLATE text/css
  AddOutputFilterByType DEFLATE text/html
  AddOutputFilterByType DEFLATE text/javascript
  AddOutputFilterByType DEFLATE text/plain
  AddOutputFilterByType DEFLATE text/xml
&lt;/IfModule&gt;
</code></pre>