I tend to use a dirty hack to a corefile to achieve the goal with urls added by users (Mycode_url).
that means editing
inc/class_parser.php by commenting out at around line: 1124:
if(!empty($this->options['nofollow_on']))
{
$rel = " rel=\"noopener nofollow\"";
}
else
{
$rel = " rel=\"noopener\"";
}
And placing below it:
/** haq
Added: For creating external reference in rel tags
**/
$reltypes="noopener nofollow external ugc";
$pos = stripos($url, "domain.tld");
$pos1 = stripos($url, ".");
if(($pos !== false) && ($pos1 <= $pos-1))
{
$reltypes="noopener";
}
$rel = " rel=\"".$reltypes."\"";
This takes into account that the url includes a subdomain (
www.domain.tld)
As the needles test that a first "."(pos1) exists before "domain.tld"(pos) (and that domain.tld exists) So it might not work in your case without tinkering.
It could be possible to write a variation for testing an array but that then adds more workload to the script.
Also note down the change you've made since any core update to the file will wipe out the edit.
Note: I negated
options['nofollow_on'] since to be honest I couldn't work out how to set it to the parser. Maybe I'm blind or limited in knowledge on how it's applied but it's worked around.