手抄报 安全手抄报 手抄报内容 手抄报图片 英语手抄报 清明节手抄报 节约用水手抄报

如何批量替换或者删除wordpress文章中的文字

时间:2024-10-14 05:03:12

1、在WordPress主题 的 functions.php 文件中添加如下代码:

2、functio艘绒庳焰n replace_text_xintheme($text){ $replace = array( //媪青怍牙'关键词' => '将要替换的关键词' '例子' => '案例', 'WordPress' => 'WordPress主题', ); $text = str_replace(array_keys($replace), $replace, $text); return $text;}add_filter('the_content', 'replace_text_xintheme');add_filter('the_excerpt', 'replace_text_xintheme');

3、按照上面的方法就可以了,是不是很简单快速呢?

© 手抄报圈