Title: Removing query strings from static resources with PHP
Last modified: June 30, 2017

---

# Removing query strings from static resources with PHP

 *  [semperaye](https://wordpress.org/support/users/semperaye/)
 * (@semperaye)
 * [8 years, 11 months ago](https://wordpress.org/support/topic/removing-query-strings-from-static-resources-with-php/)
 * Hello,
 * I am having an issue with my beaver builder background on my home page disabling
   when I have the following code activated:
 * 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 );
 * Is there a way to exclude certain resources with a ? in the url. So I can exclude
   those images that are lost by this?
 * Thanks

Viewing 1 replies (of 1 total)

 *  Thread Starter [semperaye](https://wordpress.org/support/users/semperaye/)
 * (@semperaye)
 * [8 years, 11 months ago](https://wordpress.org/support/topic/removing-query-strings-from-static-resources-with-php/#post-9276264)
 * I’ve tested using w3tc instead, and w3tc seems to know how to avoid certain resources.
   W3tc only eliminates a few of the query strings however, so it would still be
   nice to know if there was another way because this php code really speeds everything
   up.

Viewing 1 replies (of 1 total)

The topic ‘Removing query strings from static resources with PHP’ is closed to new
replies.

## Tags

 * [php](https://wordpress.org/support/topic-tag/php/)
 * [snippet](https://wordpress.org/support/topic-tag/snippet/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 1 reply
 * 1 participant
 * Last reply from: [semperaye](https://wordpress.org/support/users/semperaye/)
 * Last activity: [8 years, 11 months ago](https://wordpress.org/support/topic/removing-query-strings-from-static-resources-with-php/#post-9276264)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
