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:


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?

1 Answer 1


I solved this by creating a Redactor plugin that listens for the link.inserted event and strips out the site identifer:


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


    "plugins": ["myplugin"]

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.