Remove query strings from static resources

Posted in: Newspaper
Post count: 13

Please help me find a way to fix this problem (see image) I have been trying to fix it for weeks.

Error

I have tried installing plugins such as “Remove query strings from static resources” and “remove query strings” I have also installed pieces of code here and there I found online and no luck.

My site is connected to cloudflare so after I make any changed I am always sure to purge the cache there to see the current version of the site.

I have an admin account I can send someone to log in and fix this for me, I can even kick you a few bucks via paypal so you can go out and have some drinks on me.

The website is http://www.alexpoucher.com – you can see the F grade in the Pingdom Sitespeed Test here (Remove query strings from static resources RESULT) https://tools.pingdom.com/#!/KHaIG/alexpoucher.com

Post count: 13

bump

Post count: 13

bump, is this the support forum? I have a valid key I bought your product, where is the support?

Post count: 9544

That is not part of theme…. it’s inherent to how wordpress works.

Plenty of tutorials online for how to optimize your site.

For my examples of how to remove the query strings see my long winded thread in the theme docks > DIY / Tutorials > best of forums …

Basically you need to add a couple of lines to your functions.php file to remove “query strings” from your WordPress head/META data.

Also, if you’re using caching/CDN, most of the settings related to caching are in your caching/CDN setup and not the theme!

Good luck!

Post count: 13

I have read many tutorials, followed along best I could, still no luck, what is the code I put in functions.php to fix it? I have tried fixing this myself for the last couple weeks with no luck, I was promised support when I bought this theme I will need more than you just sending me to a url and telling me to figure it out myself, the problem has existed ever since switching to Newspaper and before signing up for Cloudflare, can I message someone an admin login for my site and you log in and fix this for me? I can pay you via paypal for fixing this. I am desperate please help.

Post count: 9544

Did you check your cloudflare settings? Turn off versioning? Read their docs on query strings and caching levels?

https://support.cloudflare.com/hc/en-us/articles/200168256-What-are-CloudFlare-s-caching-levels-

Did you check my tutorial for site optimization — did you look for it ?

I don’t work here, sorry.

Post count: 9544

Also note ‘bumps’ only push your request further down the queue, not up in the support queue; so best to avoid doing that!

Post count: 9544

If you have trouble navigating in the theme docs here on the forum to the tutorials, here is link to my thread on optimization which can help you with some cool things for the functions.php file, such as removing query strings, emojis, etc. — easier to start on last couple of pages, frankly, than oldest pages — unless you want to

https://forum.tagdiv.com/topic/tutorial-chriss-custom-optimizations-for-functions-php-etc/

as one example
function remove_cssjs_ver( $src ) {
if( strpos( $src, '?ver=' ) )
$src = remove_query_arg( 'ver', $src );
return $src;
}
add_filter( 'style_loader_src', 'remove_cssjs_ver', 10, 2 );
add_filter( 'script_loader_src', 'remove_cssjs_ver', 10, 2 );

this won’t help probably with anything loaded off your CDN if they insert versioning for “cache busting” … where versioning is intentional to force re-cache when changed.

So, you need to figure out settings for your cdn/caching setup, as well as something like the above for WordPress generated elements.

Again – neither is theme related, but hopefully this will help in some way.

Post count: 13

Yes I have read your post. I have just spent the last 2 hours trying everything you have mentioned. When I added the above code to functions.php the site quit working and I had to install the original functions.php to fix it. I have also read all documentation on CloudFlare.

The only query option CloudFlare has is this >

cache

According to Cloudflare to remove everything starting with the ? you should use the Ignore Query String setting, I am currently using this setting and the problem is still there, for posterity I have tried every setting and it still doesn’t fix the issue.

cache levels

Your above code reads

if( strpos( $src, '?ver=' ) )

but as you see here most of my problems are query strings that are ?resize= and ?oh= and ?ig_cache_key=

error

so should your code be modified to something like this?

function remove_cssjs_ver( $src ) {
if( strpos( $src, '?ver= ?resize= ?oh= ?ig_cache_key=' ) )
$src = remove_query_arg( 'ver', $src );
return $src;
}
add_filter( 'style_loader_src', 'remove_cssjs_ver', 10, 2 );
add_filter( 'script_loader_src', 'remove_cssjs_ver', 10, 2 );

or maybe something like this so all urls with a ? in it gets fixed?

function remove_cssjs_ver( $src ) {
if( strpos( $src, '?*' ) )
$src = remove_query_arg( 'ver', $src );
return $src;
}
add_filter( 'style_loader_src', 'remove_cssjs_ver', 10, 2 );
add_filter( 'script_loader_src', 'remove_cssjs_ver', 10, 2 );

If you would be willing to message me, I can give you admin access to my cpanel, ftp, cloudflare and website and once you fix it I will send you 85 dollars to your paypal account, please help me.

Post count: 9544

Are all those images loading off wp.com using jetpack, Photon, or something?

Probably good to figure out what is loading that stuff and where.

In our case we have dedicated server where we can control all this stuff vs having it load off of multiple other people’s websites, where you are limited by their control.

The theme is not causing your images to load on wp.com for example, so you need to figure out what is doing that then adjust settings for same.

Post count: 13

Yes I am using Jetpack and Photon, but I am using the “Publicize” plugin from Jetpack, so I need it. I could possibly do away with Photon though since I am using WP Smush to optimize photos, do you think just disabling Photon and the problem is fixed 100%? I will try it and report back.

Post count: 13

ok, so I disabled Photon in jetpack, cleared all my caches, re-ran a site test and the “remove query strings from static resources” went from a score of 17 to a score of 88! Almost of them are gone but not all of them yet.

static

While it almost fixed the original problem it seems it has caused an entire new problem that I have never seen before, it never existed see below

0

How do I go about fixing what the first fix caused now?

Viewing 12 posts - 1 through 12 (of 12 total)
The forum ‘Newspaper’ is closed to new topics and replies.