Custom javascript in WriteFreely 0.81

Created a local Windows 10 Development install of WriteFreely 0.81 to get familiar with it.

On the Customization page, I see how to input Custom CSS, but I don’t see anything for entering custom Javascript. Does this capability exist in WriteFreely 0.81?

There’s no way to use custom Javascript in WriteFreely 0.8.1.

I left it out to prevent security issues that might come up on multi-user instances. But are you running a single-user instance?

Yes, a single-user instance on a local machine with sqlite3, I might use it for keeping track of notes, references, links, to-do list items, items I won’t post online, etc. Got it up and running with no issues, instructions were very helpful.

Maybe this can be an option for admin on a per instance (or per blog) basis. Personally I use JS on to insert non-breaking spaces used by French typographic rules… Very useful.


I made a post on one of my blogs about custom JavaScript and French typography in… obviously it’s in French :sunglasses:


Thanks for posting, Aris. I found that did a good job of converting it to English.

1 Like

Hi, I just set up a single instance blog on my VPS with WriteFreely… Can I place some JS into a template file or something? I am going to be poking around myself but thought I would ask if there was a best practice first.

Great blogging software! I love the ease of use and minimalist approach.

1 Like

I eventually just put my JS snippet into every template file and restated WF. It seems to have worked. I was trying to find a “footer” template (or any “every page” template) but nothing I found seemed to include the script on every page so I gave up and just put it everywhere. Not super-helpful to anyone else but hopefully, someone will figure out how to do this better than I have.

1 Like

Hey, sorry I never got back to you earlier. It’s true the templates aren’t really set up for this right now.

I think ultimately we’re moving towards having common elements like this stored in the database and editable from the admin interface – and ideally supporting this by v1.0. So if you don’t mind sharing, what was the JS for? This will help inform what kind of capabilities we build.

Hi Matt, the JS was Google Analytics tracking code. I get NO traffic but I like to have analytics there just for fun. I am a web developer, though, and would like to have a way to add on JS I write if I want to make a custom widget or something for the front end.

<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src=""></script>
  window.dataLayer = window.dataLayer || [];
  function gtag(){dataLayer.push(arguments);}
  gtag('js', new Date());

  gtag('config', 'UA-XXXXXX-1');

Sorry to dig up an old thread, Matt - but I am just looking for the same possibility of running light javascript in some WF pages.

I imagined it was off for security reasons; and asked my gracious host, at for assistance. They pointed me to this thread.

I have a very short script which is useful for a Custom Google Search engine, strictly for my own blog pages. It works well, but would be ideal if this could be an option - allowed in the Settings panel, possibly?

It might be shown in the footer of every page, and the user configurable parameter would be simply the string of characters cx, that defines the specific page as added by the user to GCSE. This code is what I need :

`<script async src=""></script>`
`<div class="gcse-searchbox"></div>`

and the results area below :

`<div class="gcse-searchresults"></div>`

Thank you !

Are script includes on the roadmap? I checked Phabricator but didn’t see it there.

I’m mostly interested in including an analytics script tag (not GA).

I managed to sneak my analytics JS code into the end of the Custom CSS box by ending the </style> tag, adding the JS and then opening another <style> tag.


/* custom CSS */

<!-- Fathom - simple website analytics - -->
(function(f, a, t, h, o, m){
	o.async=1; o.src=t;'fathom-script';
})(document, window, '//', 'fathom');
fathom('set', 'siteId', 'ABCDE');
<!-- / Fathom -->

<style type="text/css">
/* closed by the code which injects the custom CSS */


I just tried @infuerno hack and it is a very good shortcut to add plausible to a specific blog without creating a breach on drafts. thanks very clever and simple.

anyone has tried to add cusdis with @infuerno 's hack?

I m trying to doing with this method, but it is not working for me

Hi @matt i hope you are well. I would like to know, why is there no custom javascript for single-user instances?

Best regards