+8 votes
by (200 points)
Hi guys!  I have a question; to optimize the speed of my website and for the privacy, i want to add shortcode in the .Hi guys! I have a question; to optimize the speed of my website and for the privacy, i want to add shortcode in the . htacces file that the code of third parties only load when the rest of the page had loaded. (as example: google analytics, hotjar, fb pixel etc) they're now loading immediatly. Does anybody know what the rule/code is? Or how tho accomplish this? Cant find it on Google.  
Hi guys!  I have a question; to optimize the speed of my website and for the privacy, i want to add

8 Answers

+3 votes
by (720 points)
Isn't it easier to use a caching plugin like WP Rocket and have such scripts load after page load?  
+4 votes
by (14.3k points)
From the terms you use, I'd say you better leave your htaccess file untouched, for the sake of your site
by (1.7k points)
@kingfisher13887 you crack me up.  
+2 votes
by (290 points)
If you load GA too late you may miss users that leave the site within first few seconds and other important metrics.  
+6 votes
by (1.7k points)
Don‘t use htaccess. It‘s better to load scrips async and defer to avoid render blocking scripts. this Is a Post about this topic in german Language but you can translate it and look for similar explanations in your country  
https://staticweb.de/javascript-ver...aden/
+5 votes
by (270 points)
Unless it bogs load time way down, I don’t worry about it to much. I do focus on time to first byte though
+4 votes
by (1.7k points)
Set an event for the page to load through jQuery then load the 3rd party scripts.  
+1 vote
by (1.2k points)
I just used Fast Velocity Minify along with WP Super Cache Plugin and the results were amazing. I got 90% on GTMetrix and even on Google Page Speed lol  
by (1.2k points)
For caching you can use WP Super Cache, W3 Total Cache or WP Rocket but Fast Velocity Minify is a must use plugin.  
+6 votes
by (600 points)
Async them.  
The Search Engine Optimization Group is where you can always find questions, answers, advice, reviews & recommendations from other community members about better strategy on ranking highly for search engine results.
...