Due to updates, over time, that have been made to the site and the age of this article, this post may not display correctly. In particular images may be missing or product reviews display incorrectly.

If this is the case and you'd particularly like me to fix it, then please reach out to me on Twitter.

One of the problems with having external scripts on your site is that you have little control over them – caching and the like are out of your hands.

The solution I’m using, via cPanel, is a weekly cron job that copies external scripts to a folder on my own server. And it will only do this if the script has only changed, as well.

I’m no Linux expert (or probably even amateur, if I’m honest) so it took a while to find the right code to use, but here is the result…

Simply change [local folder] to where you wish the script to be copied to and [script location] to where the external script is held (including script name). If you wish to perform multiple copies you can append them together with &&.

So an example may be…

This would copy the AdSense code show_ads.js to a theme folder named “artiss”.