How to remove/replace code.jquery.com?

Hi!

Is it possible to replace/remove code.jquery.com from Ghost? Our project aims to have zero tracking and 3rd party websites in the background.

Thanks for the help.

If you’re using the default Casper theme, it requires jQuery for some of the theme functionality.

That said, you should be able to modify the theme yourself to remove the dependency on code.jquery.com specifically. What you’ll need to do is download the Casper theme from your blog (see docs), then download the jquery code from code.jquery.com (specifically https://code.jquery.com/jquery-3.4.1.min.js). After downloading the jquery code, save it to your theme’s assets/built folder as jquery.js and update this line in default.hbs (Casper/default.hbs at main · TryGhost/Casper · GitHub) to use the following snippet:

<script src="{{asset "built/jquery.js"}}"></script>

Once you’ve done that, re-upload your theme zip file and it should no longer be requesting files from code.jquery.com

3 Likes