WordPress教程 —— 批量更换文章内域名
此教程可以应用搬家的时候更换域名路径,比如 原域名 a.com 批量更换成 b.com:
教程开始
进入路径: themes/主题/functions.php
将以下代码加入
function replace_text_wps($text){ $replace = array( 'https://老域名' => 'https://新域名', ); $text = str_replace(array_keys($replace), $replace, $text); return $text; } add_filter('the_content', 'replace_text_wps'); add_filter('the_excerpt', 'replace_text_wps');
即可!
资源来源于网络,模板仅供测试,您必须在下载后的24个小时之内,从您的电脑中彻底删除内容资源!如用于商业或者非法用途,与本站无关,一切后果请用户自负!
本站提供的源码、模板、插件等等其他资源,都不包含技术服务请大家谅解! 如有链接无法下载、失效,请联系管理员处理!
转载请注明出处,谢谢配合!
晨夕阁 » WordPress教程 —— 批量更换文章内域名