Artikel Directory
trochWordPress artikel automatyske plugin foar ankertekst Automatyske ynterne keppelings foar SEODe automatyske ankertekstfunksje fan it label wurdt net stipe.
As jo kinne tafoegje tag kaaiwurd anker tekst, it kin net allinnichSEOOptimalisearje ús ynterne keppelings, en lit brûkers ek ferwize nei relatearre artikels.
WordPressHoe foegje tags automatysk ynterne keppelings ta?

Dus hoe meitsje de artikels op 'e WordPress-webside automatysk tag ynterne keppelings taheakje?
Yn feite, wy moatte allinnefunctions.phpFoegje yn it bestân in stikje php-koade ta om it te berikken.
WordPress Post-ynhâld-tags automatysk tafoegje ankertekst ynterne keppelings
/**
* WordPress文章内容标签自动加锚文本内链
* https://www.chenweiliang.com/cwl-27651.html
**/
function wptag_auto_add_anchor_text_link($content){
$limit = 1; // 设置WordPress文章同一个标签,自动添加几次内链?
$posttags = get_the_tags();
if ($posttags) {
foreach($posttags as $tag) {
$link = get_tag_link($tag->term_id);
$keyword = $tag->name;
$cleankeyword = stripslashes($keyword);
$url = '<a target="_blank" href="'.$link.'" title="'.str_replace('%s', addcslashes($cleankeyword, '$'), __('View all posts in %s')).'">'.addcslashes($cleankeyword, '$').'</a>';
$regEx = '\'(?!((<.*?)|(<a.*?)))('. $cleankeyword . ')(?!(([^<>]*?)>)|([^>]*?</a>))\'s';
$content = preg_replace($regEx,$url,$content,$limit);
}
}
return $content;
}
add_filter( 'the_content', 'wptag_auto_add_anchor_text_link', 1 );Koade tafoegje oan WordPressTemafunctions.phpNei it bestân, lês ús artikel nochris.
Is d'r in automatyske tafoeging fan ynterne keppelings as de tag-kaaiwurden dy't wy tafoegje ferskine?
Hope Chen Weiliang Blog ( https://www.chenweiliang.com/ ) dield "Hoe kinne jo ynterne keppelings yn WordPress ynstelle? Automatysk ankertekstoptimisaasje tafoegje oan artikelynhâldtags", wat jo nuttich is.
Wolkom om de keppeling fan dit artikel te dielen:https://www.chenweiliang.com/cwl-27651.html
