Dear Lucian
Thanks for your response. but it sounds like an auto response sent to everyone with this query. Render blocking Javascripts include
1. contact-form-7/includes/js/jquery.form.min.js (should not be there as it is part of theme package)
2. contact-form-7/includes/js/scripts.js (should not be there as it is part of theme package)
3. http://s0.wp.com/wp-content/js/devicepx-jetpack.js
4. /wp-content/themes/Newspaper/js/td_external.js (should not be there as it is part of theme package)
5. /wp-content/themes/Newspaper/min/site.min.js (should not be there as it is part of theme package)
6. /wp-includes/js/thickbox/thickbox.js
7. /wp-content/plugins/Js_composer/assets/js/js_composer_front.js (should not be there as it is part of theme package)
8. /wp-includes/js/comment-reply.min.js
You might have noticed above that I have in fact added ID’s of blocking styles and Js at the appropriate place in speedbooster plugin but these are still appearing in Pagespeed insights results.
Can you please guide to resolve the matter as suggested solution is assumingly not working
Help is requested regarding how to get rid of render blocking Javascript and CSS. I have gone through the pagespeed guide and all 14 pages of sticky post titled Pagespeed but could not figure out how to achieve this.I have speed booster plugin installed and have retrieved registered scripts and styles using the code provided in pagespeed guide.
Render blocking scripts and styles are different than registered scripts. so,
1. How can I register unregistered scripts
2. Where to place ID’s on speedbooster plugin
I need little bit of guidance.
Kind Regards
Azhar Nadeem
sportscourant.com
Sure you could hack that with CSS, but it’s still not going to be proportionally correct. And Google will ding you for “resizing” the image vs serving the image “at actual size” in pagespeed insights.
All the plugin does is re-enable the function that wordpress SHOULD have but they disable; which allows a new image to be written to fill the space and crop to fit.
Okay. And ?
The htaccess file does nothing whatsoever related to “render blocking” CSS/JS; that is not its purpose.
The htaccess file gives directives for the server, running “above” the site for caching, expiration, redirects, etc.
Mod_Pagespeed settings won’t do anything unless your server has that.
Obviously your permalink structure for WordPress should be in your file (missing from your example).
You don’t need two sets of expire headers (!).
All of the above is to help with optimization of page loading — nothing to do with HOW the content loads on the page (aside from mod_pagespeed of course).
The only way to optimize for the CSS/JS render blocking is to build custom site without all the bells and whistles and custom load content in groups; and you can optimize some of that with the tagdiv speed booster plugin.
this is my htaccess file
<IfModule mod_deflate.c>
<filesMatch "\.(js|css|html|php)$">
SetOutputFilter DEFLATE
</filesMatch>
</IfModule>
# Pagespeed Module
<IfModule pagespeed_module>
ModPagespeed on
ModPagespeedEnableFilters collapse_whitespace
ModPagespeedEnableFilters remove_comments
ModPagespeedEnableFilters rewrite_images
ModPagespeedEnableFilters insert_dns_prefetch
</IfModule>
# Pagespeed Module
# BEGIN Expire headers
<ifModule mod_expires.c>
ExpiresActive On
ExpiresDefault "access plus 5 seconds"
ExpiresByType image/x-icon "access plus 604800 seconds"
ExpiresByType image/jpeg "access plus 604800 seconds"
ExpiresByType image/png "access plus 604800 seconds"
ExpiresByType image/gif "access plus 604800 seconds"
ExpiresByType application/x-shockwave-flash "access plus 604800 seconds"
ExpiresByType text/css "access plus 604800 seconds"
ExpiresByType application/x-font-woff "access plus 604800 seconds"
ExpiresByType text/javascript "access plus 604800 seconds"
ExpiresByType application/javascript "access plus 604800 seconds"
ExpiresByType application/x-javascript "access plus 604800 seconds"
#ExpiresByType text/html "access plus 600 seconds"
#ExpiresByType application/xhtml+xml "access plus 600 seconds"
</ifModule>
# END Expire headers
# END WordPress
AddType text/javascript .js
AddType application/vnd.ms-fontobject .eot
AddType application/x-font-ttf .ttf
AddType application/x-font-opentype .otf
AddType application/x-font-woff .woff
# BEGIN Expire headers
<IfModule mod_expires.c>
ExpiresActive On
ExpiresDefault "access plus 5 seconds"
ExpiresByType image/x-icon "access plus 2500000 seconds"
ExpiresByType image/jpeg "access plus 2500000 seconds"
ExpiresByType image/png "access plus 2500000 seconds"
ExpiresByType image/gif "access plus 2500000 seconds"
ExpiresByType application/x-shockwave-flash "access plus 2500000 seconds"
ExpiresByType text/css "access plus 700000 seconds"
ExpiresByType text/javascript "access plus 700000 seconds"
ExpiresByType application/javascript "access plus 700000 seconds"
ExpiresByType application/x-javascript "access plus 700000 seconds"
ExpiresByType text/html "access plus 600 seconds"
ExpiresByType application/xhtml+xml "access plus 600 seconds"
ExpiresByType font/truetype "access plus 2500000 seconds"
ExpiresByType font/opentype "access plus 2500000 seconds"
ExpiresByType application/x-font-woff "access plus 2500000 seconds"
ExpiresByType image/svg+xml "access plus 2500000 seconds"
ExpiresByType application/vnd.ms-fontobject "access plus 2500000 seconds"
</IfModule>
# END Expire headers
# BEGIN Cache-Control Headers
<IfModule mod_headers.c>
<filesMatch "\.(ico|jpe?g|png|gif|swf)$">
Header set Cache-Control "public"
</filesMatch>
<filesMatch "\.(css)$">
Header set Cache-Control "public"
</filesMatch>
<filesMatch "\.(js)$">
Header set Cache-Control "private"
</filesMatch>
<filesMatch "\.(x?html?|php)$">
Header set Cache-Control "private, must-revalidate"
</filesMatch>
</IfModule>
# END Cache-Control Headers
<IfModule mod_headers.c>
Header unset ETag
</IfModule>
<IfModule mod_alias.c>
RedirectMatch 403 /xmlrpc.php
</IfModule>
This is a recent development this year with insights; kind of annoying; and why you get higher score with GTmetrix than insights score. With “responsive” design, images are often resized vs serving an entirely new image as traditionally it was actually faster since the server caches images, especially high request images. However, now the insights score is based on a “mobile user loading the content” as part of the “mobile first” movement, and so it seems there is going to need to be some kind of element added to all themes which load images much like the ad banners used to load the past few years prior to Google adding responsive ad units …
basically…
if viewport large = load big image
if viewport small = load thumbnail
Dumb thing is that in many cases, the larger image being loaded on mobile, e.g., iPad actually works better as a “resized” image, since it effectively makes a 640×400 96dpi image into a 340×200 200dpi image for retina displays by having larger pixel density when the large size is reduced on screen — hence why the images look so good on retina mobile devices without having to reload a “retina image…”
So….. stupidly, they are looking at “bandwidth” not “quality”…
Themes are basically going to have to be re-engineered to “by default” always make something like a 50% thumbnail and serve that on mobile devices.
Even stupider requirement because not all mobile devices have same viewport, and so it’s not practical for every page to constantly load 10 different size “featured images” based on viewport — this is what responsive design partially solved.
Upshot — you can live with suffering the warning for now — everybody is getting this — everywhere.
Not sure how TagDiv will address this, or if some super clever person comes up with plugin.
In our case we’re running mod_pagespeed and just updated last Friday (week ago), in hopes it would have solution for this as part of the “resize images” function (well, subset of “rewrite images”), and that isn’t even doing that with Google’s own technology!
(argh)….
Sorry for editorial. I started trying to deal with this April 1, and was super annoyed by the “actuality” of the issue.
Basically a featured image now has to be treated as an “ad module” and load a different size main image based on desktop v mobile. Show me any themes doing that right now. Nope. Annoying.
Hope that helped in some way …. main thing is to ensure the main images you’re uploading are as compressed as possible. I’ve been trying to make sure our larger images are no more than 25kb vs 32kb. If you have an image with 120kb that can be removed, it might be too big to start with.
No simple answer.
I have a question. If I use google PageSpeed Insights on my site http://modetilkvinder.dk/ I get a red warning for image on Mobile – and that I can reduce my images with 120 kb (90% reduction) I don’t have the same issue on desktop. I am already using WP Smush.it and have optimized all images before uploading to media library. How do I Optimize images for mobile further? and get rid of the red warning?
Regards
Ulrik
Hi,
First of all i’m not a developer i’m a designer/new to wordpress:.I followed the guide by Chris S, it was little bit hard for me to understand all of that, english is not my main language.I did everything i could to improve my pagespeed.I get 89 on desktop and 74 on mobile.I asked developers at my work, they were unable to help or they just sent me away.
In your guide on eliminateing render-blocking js…. i did everything as said but where or how can i look for ids of these files :

This is my ids for all css & js.
registered scripts
common | /wp-admin/js/common.min.js
admin-bar | /wp-includes/js/admin-bar.min.js
dashboard | /wp-admin/js/dashboard.min.js
customize-loader | /wp-includes/js/customize-loader.min.js
plugin-install | /wp-admin/js/plugin-install.min.js
media-upload | /wp-admin/js/media-upload.min.js
thickbox | /wp-includes/js/thickbox/thickbox.js
utils | /wp-includes/js/utils.min.js
svg-painter | /wp-admin/js/svg-painter.js
wp-auth-check | /wp-includes/js/wp-auth-check.min.js
td-wp-admin-general | http://domain/wp-content/themes/Newspaper/wp-admin/js/general.js
td-wp-admin-panel-js | http://domain/wp-content/themes/Newspaper/wp-admin/js/wp-admin-panel.js
akismet.js | domain/wp-content/plugins/akismet/_inc/akismet.js
registered styles
admin-bar | /wp-includes/css/admin-bar.min.css
jetpack-dashboard-widget |domain/wp-content/plugins/jetpack/css/dashboard-widget.css
thickbox | /wp-includes/js/thickbox/thickbox.css
colors | 1
ie | /wp-admin/css/ie.min.css
wp-auth-check | /wp-includes/css/wp-auth-check.min.css
google-font-ubuntu | http://fonts.googleapis.com/css?family=Ubuntu:300,400,500,700,300italic,400italic,500italic,700italic&subset=latin,cyrillic-ext,greek-ext,greek,latin-ext,cyrillic
td-wp-admin-td-panel-2 | domain/wp-content/themes/Newspaper/wp-admin/css/wp-admin.css
wp-color-picker | /wp-admin/css/color-picker.min.css
wpalchemy-metabox | domain/wp-content/themes/Newspaper/wp-admin/content-metaboxes/meta.css
akismet.css | domain/wp-content/plugins/akismet/_inc/akismet.css
jetpack-icons | domain/wp-content/plugins/jetpack/css/jetpack-icons.min.css
jetpack | domain/wp-content/plugins/jetpack/css/jetpack-banners.min.css
Minify :
Google provides optimized images, JavaScript, and CSS resources for this page.
Is this worth to use? will it work?
thanks.
Hi,
Please make sure that your Social Counter plugin is updated to the latest version 2.9 and you follow this guide to set it: https://forum.tagdiv.com/how-to-manage-the-social-counter/
If you need to update the plugin you ca find it in theme files that you downloaded from themeforest in /plugins folder.
You can use the tagDiv Speed Booster plugin to move the css and js at the bottom of the page avoiding the page render blocking: https://forum.tagdiv.com/how-to-make-the-site-faster/ – https://forum.tagdiv.com/pagespeed-guide/
Please check Revolution Slider documentation if you want to use it: http://revolution.themepunch.com/documentation/
Thanks!
Made the change but it doesn’t have any effect. Pagespeed Insight give still the above recommendations.
If the “td-inspect-scripts” in functions.php indicates;
google-font-rest |
td-bootstrap |
td-theme |
Doesn’t it mean that those CSS style are moved to the footer? (the fact that it indicates the ID but after the | no further reference)
Hello,
I am struggling to raise my page speed score on Google.
When testing my site at the page speed insight tool I get 80 on desktop and 49 on mobile.
I have read the speed guide and everything in your knowledge database, but can’t get a page speed above 80. I would really like to have more than 85 at least.
Somehow I have a lot of rendering blocking css files. How can I get rid of them?
Also I am using the Font “Lato” instead of Roboto Condensed, but my website is still fetching Roboto Condensed…
Thanks for your feedback!
I’ve added compression and browser caching to .htaccess I’ve ran another pagespeed test and now it shows “only”;
http://fonts.googleapis.com/…ed:400italic,700italic,400,700?ver=4.6.2
http://<mydomain>.com/…nal/bootstrap/td-bootstrap.css?ver=4.6.2
http://<mydomain>.com/…ent/themes/Newspaper/style.css?ver=4.6.2
So forget my remarks above about JS but how do I get rid of the css’s above the line? Especially that google-font thing is annoying me;-)
Lucian,
The instructions are clear and it works. Thanks for your help.
But still I’m wondering why the following code isn’t moved to the footer. Below a snapshot of what pagespeed insight is saying;
http://ajax.googleapis.com/…s/jquery/1.11.1/jquery.min.js?ver=1.11.1
http://<mydomain>.com/…es/Newspaper/js/td_external.js?ver=4.6.2
http://<mydomain>.com/…s/Newspaper/js/min/site.min.js?ver=4.6.2
http://<mydomain>.com/…cludes/js/comment-reply.min.js?ver=4.1.1
http://fonts.googleapis.com/…ed:400italic,700italic,400,700?ver=4.6.2
http://<mydomain>.com/…nal/bootstrap/td-bootstrap.css?ver=4.6.2
http://<mydomain>.com/…ent/themes/Newspaper/style.css?ver=4.6.2
http://<mydomain>.com/…ssets/css/essb-sidebar.min.css?ver=4.6.2
http://fb.creoworx.com/…lat-retina/easy-social-share-buttons.css
I’ve identified the ID’s added the ID’s to the Speed-Booster “move-to” instruction plugin.
The screenshot after the adaptations in functions.php shows:
registered scripts
admin-bar | /wp-includes/js/admin-bar.min.js
td-external | http://<mydomain>.com/wp-content/themes/Newspaper/js/td_external.js
td-site-min | http://<mydomain>.com/wp-content/themes/Newspaper/js/min/site.min.js
jquery | http://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js
registered styles
admin-bar | /wp-includes/css/admin-bar.min.css
easy-social-share-buttons-sidebar |
boxes | http://<mydomain>.com/wp-content/plugins/wordpress-seo/css/adminbar.min.css
google-font-rest |
td-bootstrap |
td-theme |
But Pagespeed Insight is still complaining about it. To me it seems that the JS code isn’t moved even-though I’ve added it to the speed-booster plugin php. “easy-social-share-buttons-sidebar” and “td-bootstrap” are moved but still pagespeed is mentioning it. What can I do?
Hi,
I have tested your site with google page speed: https://developers.google.com/speed/pagespeed/insights/?url=http%3A%2F%2Fwww.autismestart.nl%2F&tab=desktop You can see that also your server cause this issue.
For image compression we recommend a plugin like Smush it: https://wordpress.org/plugins/wp-smushit/ or add the following code in functions.php:
add_filter( 'jpeg_quality', create_function('', 'return 50;' ) );
This will compress all images to 50%, you can change that value, after you add the code you have to regenerate all thumbs – https://forum.tagdiv.com/how-to-fix-strange-thumbnails/
Please set Leverage browser caching using this guide: https://forum.tagdiv.com/how-to-make-the-site-faster/ and you can disable page views from modules it may also help: http://screencast.com/t/TgDSU6xCA
Hope this helps!
Hi,
I’ve checked your and just the easy social sharing css is now detected as above the content: https://developers.google.com/speed/pagespeed/insights/?url=wefundex.com&tab=desktop
If you have added it to the speed booster plugin to be moved to the footer please make sure that you have added the stylesheet id right, as instructed in the guide/”Remove render blocking css/js – using the TagDiv Speed Boosterplugin (Advanced Users)” section: https://forum.tagdiv.com/how-to-make-the-site-faster/
This is recommended for advanced users only so if you don’t have php knowledge I suggest you get someone to help you with this.
The guide provides all the info you need to do this, you have to use the function provided in the tutorial, you could try to play with the priority, some plugins may load after it and that’s why it doesn’t return all js – http://screencast.com/t/7fhfjttAT8
http://codex.wordpress.org/Function_Reference/add_action
Hope this helps!
Please make new topics about your issues in the future.
Thanks
-
This reply was modified 11 years by
Lucian.
Hi Marius,
Please look at wefundex.com
Apparently the CSS was not moved to the footer. If you check Google Pagespeed Insight on my domain, you will notice the remarks about a.) moving css to footer and b.) reduce css, js, html code.
Thx!
Hi,
I’m using Newspaper theme in my long term blog. The theme is awesome and I’m liking it very much.. But I’m having a few issues, and I would like you to help me to resolve those issue.
1. The featured images of my site is not cropping properly, and thus the pagespeed of my homepage is worse (<45). I need to get at least 80+ Pagespeed for my blog. The featured images are not cropping, even if I select that option from theme panel. I have also regenerate all the thumbnails as mentioned in the documentation. But it didn’t work…
2. I have seen a beautiful border around the big slider on the homepage in the demo version.. But in my site, the slider doesn’t have border around it..and It looks little bit clumsy..
Plz help me to solve these issues !!!
For those specific folk using mod_pagsepeed
you may start seeing some oddities with Pagespeed Insights, where Google now telling you that stuff like a .js file or .webp file doesn’t have an expiration header over 5 minutes; where basically MPS is “intercepting” the file to serve on page build, and so a few oddities ignore the .htaccess file TTL settings (!).
The fix I discovered yesterday is adding a config line to the master pagespeed.conf file, and looks like this:
ModPagespeedImplicitCacheTtlMs 604800000
Basically this will over-ride the MPS default time to live (TTL) from 5 minutes to whatever time you want, such as a week. Note that the number is in msec not seconds (!). So, typically you need to work out that time using online converter (Google has built in function for that … !).
This was driving us nuts the other day, and this was the solution.
Depending on your server you might also need to actually add the webp MIME type to your apache mime setup file.
Hope that helped somebody!
Guys,
I’m quite new to all of this but I’m trying to improve site speed. And have 2 blocking css sources. (have read all the relevant posts, have followed Chris ‘s advice)
I’m trying to move the easy-social-share-button css files but it doesn’t seem to work. I’ve inserted below code in td-speed-booster.php
$this->move_style_to_footer('easy-social-share-buttons-css');
$this->move_style_to_footer('easy-social-share-buttons-sidebar-css');
As newspaper footer I’m using a new-made footer menu called “basis-footer”. Does that make any difference?
—
On top of above the pagespeed insight tool is suggesting to reduce CSS, JS and HTML code.
Newspaper/style.css (saving 18%)
Newspaper/td_external.js?ver=4.6.2 (saving 10%)
http://<domain> (saving 18%)
Hope you can help me. Thx in advance
Hi,
If you’ve checked your site using the Google’s page speed test tool: https://developers.google.com/speed/pagespeed/insights/ or gtmetrix you will find the reason of your slow page speed.
It might be due to your host or images, your page speed is determined by lots of factors could and the theme’s code has noting to do with it.
Customization you need todo to improve your page speed score are universal, speed optimization plugins use the same methods.
Please also provide your site’s url so we can check it and send us a message at contact@tagdiv.com if you don’t want to post your site’s url here.
Please also provide a link to this tread so we can know who you are.
Thanks
I’ve seen the forum posts about page speed, but believe it or not i didn’t buy a WYSIWYG drag and drop editor because i have great coding experience.
Not Helpful
This theme is ridiculously slow to load, in admin and published version.
Is there any simple way to speed it up without coding?
Theres virtually nothing on my site at the moment, just the theme, and it is taking 30-60 seconds to load each request. It is 100% the theme, nothing to do with coding.
Please help!
Hi,
This usually happens because of the speed booster plugin which move the css and js at the bottom of the page structure so that the page will load faster, this is why the theme color appears first then changes, because of the cascading property of css, the same regarding fonts.
What you can do is to change the color and the fonts directly into the css style-sheet which will make your colors and your fonts to load first and stay that way. You could also deactivate the plugin if you don’t need it.
For page speed you can also use our guide and some other forum treads:
* https://forum.tagdiv.com/topic/pagespeed/
* https://forum.tagdiv.com/topic/tutorial-chriss-custom-optimizations-for-functions-php-etc/
* https://forum.tagdiv.com/page-speed-guide/
Thanks!
Hi,
First of all, thank you for the detailed page speed optimization tutorial, every advice is golden.
At the first moment we achieved 94/100 on mobile and 95/100 on Google PageSpeed Insights tool
We are using all of your suggested code, and tagDiv Speed Booster plugin (which i edited as suggested and added missing render-bloking scripts)
And it worked great for a while.
Now, all of the sudden, mobile speed dropped to 68/100, but we didn’t change anything, it happened by itself. Main reason according to Google PageSpeed is appearance of render-blocking scripts again (only for mobile, which is curious.. desktop test is still 95/100, with no render-blocking scripts). I checked, and scripts reported as render-blocking on mobile ARE included in tagDiv Speed Booster and should not be render-blocking
Any ideas or tips on how we could fix this?
Our website is https://www.recepti-kuvar.rs/
Thanks in advance!
Hi,
Check the treads/guide below for more info on how to customize your site’s page speed and other matters please follow and use all instructions provided in all this treads:
* https://forum.tagdiv.com/topic/pagespeed/
* https://forum.tagdiv.com/topic/tutorial-chriss-custom-optimizations-for-functions-php-etc/
* https://forum.tagdiv.com/page-speed-guide/
Thanks
My site’s score on Google Pagespeed is really low- Mobile=18 Desktop=19
When I switched to WordPress’s original themes everything seems normal.
Could you please have a look if there are any issues I should fix?