WordPress 给关键字自动添加文章链接

WordPress 发表文章后,建立锚文本链接在网站优化中有很重要的作用,WoredPress 可通过添加函数设置特定关键字自动添加链接。方法1:添加代码实现在你的主题下面的 functions.php 文件里,添加以下代码function replace_content_keyword($content){ $rep...

WordPress 发表文章后,建立锚文本链接在网站优化中有很重要的作用,

WoredPress 可通过添加函数设置特定关键字自动添加链接。

方法1:添加代码实现

在你的主题下面的 functions.php 文件里,添加以下代码

function replace_content_keyword($content){  $replace = array(      '星速云wordpress' => '<a href="https://www.seo628.com" rel="home">星速云wordpress</a>',      'wordpress主题' => '<a href="https://www.seo628.com" rel="home">wordpress主题</a>',      'wordpress企业主题' => '<a href="https://www.seo628.com" rel="home">wordpress企业主题</a>',   );  $content = str_replace(array_keys($replace), $replace, $content);  return $content;}add_filter('the_content', 'replace_text_wps');

方法2:安装插件实现

WP Keyword Link (已下架)

Links Auto Replacer 官网:https://wordpress.org/plugins/links-auto-replacer/

Links Auto Replacer zip包:links-auto-replacer.zip

声明:本站所有文章,如无特殊说明或标注,均为本站原创发布。任何个人或组织,在未征得本站同意时,禁止复制、盗用、采集、发布本站内容到任何网站、书籍等各类媒体平台。如若本站内容侵犯了原著者的合法权益,可联系我们进行处理。

给TA打赏
共{{data.count}}人
人已打赏
wordpress教程

wordpress企业网站如何才能得到排名

2023-2-16 15:59:30

wordpress教程

强力推荐实用的29个优秀的wordpress网站插件

2023-2-16 15:59:37

!
你也想出现在这里?立即 联系我们吧!
信息
0 条回复 A文章作者 M管理员
    暂无讨论,说说你的看法吧
个人中心
购物车
优惠劵
今日签到
搜索