سلام و درود
کد زیر رو درون فایل functions.php قالبتون زیر اولین
<?php
قرار بدید.
add_filter('the_content', function($content) {
$dom = new DOMDocument();
@$dom->loadHTML(mb_convert_encoding($content, 'HTML-ENTITIES', 'UTF-8'));
$xpath = new DOMXpath($dom);
$anchor = $xpath->query('//a');
if($anchor->length === 0)
return $content;
foreach($anchor as $link) {
if($link->hasAttribute('target')) {
if(stripos($link->getAttribute('target'), "_blank") !== false) {
$link->removeAttribute('target');
}
}
}
return trim(preg_replace('/