Plugin to make labels mandatory on every page


Is there a way to ensure a label must be entered before publishing or updating a page?
A popup should appear if no label is entered.

First I tried including a JavaScript in custom HTML:

<script type="text/javascript" src="/confluence/includes/js/label_alert.js"></script>

At the moment the script looks like this:

&lt;script type="text/javascript"&gt;
      alert("Please add at least one or more labels");

I have the code from this post:

Since it is the first time that I do something with custom html and javascript, I do not know if it is correct at all. In any case, I don’t get any alerts.

I am now trying to develop my own plugin.
Can you guide me in the right way so that I habe a good start and can achieve my goal?

I would be grateful for any help!

Hello Florian,

Not an answer, but generally “only” JavaScript/HTML is not a bulletproof solution as it doesn’t force the requirement on the server side, but probably works for most users.

You may have a look at, maybe this has such a feature:

We also have this as a feature request for our but still not done anything in this direction.