I fixed this issue. Now all links showing nofollow in item description
Can you please check this code is correct
I have replaced this code
<div class="text">
<?php echo osc_item_description(); ?>
</div>
with this
<div class="text">
<?php
$description = osc_item_description();
$description = preg_replace_callback(
'/<a\s+([^>]+)>/i',
function($matches) {
if (stripos($matches[1], 'rel=') !== false) {
return '<a ' . preg_replace(
'/rel=["\']([^"\']*)["\']/i',
'rel="$1 nofollow ugc noopener noreferrer"',
$matches[1]
) . '>';
}
return '<a ' . $matches[1] . ' rel="nofollow ugc noopener noreferrer">';
},
$description
);
echo $description;
?>
</div>