How do you disable the autocomplete macros collectively, in "The Editor"?

I'm trying to reduce users reliance on macros, per customer request. I need them to use macros only through the "+" button on the editor toolbar. 

So far, the following jQuery code has not worked, and I've followed all of Confluence tutorials on their Developers' guide.

AJS.$("#d").keypress(function (e) {

var charTyped = String.fromCharCode(e.which);
if (charTyped == "{" || charTyped == "!") {


var sel = window.getSelection();
if (sel.rangeCount > 0) {

var range = sel.getRangeAt(0);

var text = (charTyped == ")") ? "{}" : "()";
var textNode = document.createTextNode(text);

range.setStart(textNode, 1);
range.setEnd(textNode, 1);


It works on JSbin, yet there is no result on Confluence. Is there a file that overrides this type of attempts that are trying to affect the autocomplete functionality?

Is there a way I can modify a local js file to disable this functionality for all users? 

1 answer

0 votes
Ann Worley Atlassian Team Oct 31, 2017

We don't recommend altering the behavior of the editor using JQuery. It could lead to unpredictable behavior in the editor.

Each user's profile has an autocomplete setting that can be disabled: Enabling and disabling autocomplete. I tested and when I disabled that setting the macro menu did not come up when I typed { into the editor.

You are right @Ann Worley, disabling the autocomplete setting works, yet you have to flip this switch, on each user's account manually. This is not efficient from an Admin perspective.

Likewise, the "@", "//", and other keyboard shortcuts are disabled when you turn the autocomplete setting off. We only need to disable the "{" and "!" keyboard shortcuts collectively for all of our Confluence users.

Suggest an answer

Log in or Sign up to answer
Community showcase
Posted Feb 06, 2019 in Confluence

Try out the new editing experience

Hi team, I’m Avinoam, a product manager on Confluence Cloud, and today I’m really excited to let the Community know that all customers can now try out the new editing experience and see some of the ...

783 views 33 5
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you