Prevent Redactor from adding site identifier to entry links I have a multi-site setup, and when using Redactor's Link to an entry function, by default, site identifiers are added to the link href:

href="https://mysite/my-page#entry:4223@3:url"

I would like to prevent (or strip out) the @3 site identifier, because I wish to use the current site's base URL, rather than specify a specific site's base URL be used. Is this possible?
I solved this by creating a Redactor plugin that listens for the link.inserted event and strips out the site identifer:

craft/config/redactor/plugins/myplugin.js:

(function($R)
{
    $R.add('plugin', 'myplugin', {
        onlink: {
            inserted: function(link) { 
                link.nodes.forEach(node =&gt; node.href = node.href.replace(/@\d+/, ''))
             },
        },
    });
})(Redactor);


craft/config/redactor/redactorFieldConfig.json:

{
    "plugins": ["myplugin"]
}