Title: Better Search Replace
Author: WP Engine
Published: <strong>2015 年 1 月 6 日</strong>
Last modified: 2025 年 12 月 8 日

---

搜索插件

![](https://ps.w.org/better-search-replace/assets/banner-772x250.jpg?rev=2706527)

![](https://ps.w.org/better-search-replace/assets/icon-256x256.png?rev=2706527)

# Better Search Replace

 作者：[WP Engine](https://profiles.wordpress.org/wpengine/)

[下载](https://downloads.wordpress.org/plugin/better-search-replace.1.4.10.zip)

 * [详情](https://cn.wordpress.org/plugins/better-search-replace/#description)
 * [评价](https://cn.wordpress.org/plugins/better-search-replace/#reviews)
 *  [安装](https://cn.wordpress.org/plugins/better-search-replace/#installation)
 * [开发进展](https://cn.wordpress.org/plugins/better-search-replace/#developers)

 [支持](https://wordpress.org/support/plugin/better-search-replace/)

## 描述

将 WordPress 站点移动到新域或服务器时，您可能需要在数据库上运行 search/replace，
以使一切正常工作。 幸运的是，有几个插件可用于此任务，但是，对于一些关键功能，它们
都有不同的方法。 该插件整合了这些插件的最佳功能，将以下功能合并到一个简单的插件中：

 * 连播支持所有的表格
 * 选择指定的表格的能力
 * 运行“试运行”以查看将更新多少字段的能力
 * 没有服务器需求来自一个运行安装的WordPress
 * WordPress多站点支持

> **时间保存功能能够在Pro版本中:**
>  * 准确查看 search/replace 期间发生的变化
>  * 备份以及导入数据库当运行 search/replace
>  * 来自开发者的优先邮箱支持
>  * 保存或者加载自定义的资料用于快速的重复 search/replace 在一个位置
>  * 支持1年的更新
> **[了解更多关于 Better Search Replace Pro](https://bettersearchreplace.com/)**

搜索和替换功能在很大程度上基于互连/它是伟大的开源搜索替换数据库脚本，修改为使用 
WordPress 本机数据库功能以确保兼容性。

**支持的语言 **

 * 英国
 * 法国
 * 德国
 * 西班牙

** 想要继续?**

请随意提交一个问题或者提交一个请求在[GitHub](https://github.com/deliciousbrains/better-search-replace/).

## 屏幕截图

 * [[
 * The Better Search Replace Page 添加到 ”Tools“ 菜单
 * [[
 * 在进行了 Search/Replace 试运行之后

## 安装

安装Better Search Replace 就想你安装其他的WordPress插件一样

Dashboard 方法：

 1. 登陆你的WordPress admin 然后去到 Plugins -> 添加新的
 2. 输入”Better Search Replace” 再搜索栏中并且选择这个插件
 3. 点击“安装”，然后”激活插件“

上传方法：

 1. 解压插件并且上传“better-search-replace”文件夹到你的”wp-content/plugins”目录
 2. 在WordPress中通过插件菜单激活插件

## 常见问题

### 使用Better Search Replace

一旦激活，Better Search Replace 会在WordPress 管理员的 “Tools” 菜单页面添加一个页
面。

### 我的主机是否支持？

是的！这个插件应该与任何主机兼容。

### 这个插件会损坏我的网站吗？

Yes! Entering a wrong search or replace string could damage your database. Because
of this, it is always advisable to have a backup of your database before using this
plugin.

### 这个怎么用于WordPress 多站点？

When this plugin is installed on a WordPress multisite network:

 * Subsite administrators can only search and replace within tables that belong 
   to that subsite by visiting Dashboard > Tools > Better Search Replace from WP
   Admin of the subsite.
 * Network administrators (i.e. Super Admins) and administrators of the primary 
   site can search and replace across all tables in the multisite network by visiting
   Dashboard > Tools > Better Search Replace from WP Admin of the primary site.

To change which users have access to the plugin, the user capability can be modified
via code using the `bsr_capability` filter.

### 当改变URLs的时候我怎么使用插件？

如果您要将站点从一台服务器移动到另一台服务器并更改 WordPress 安装的 URL，以下方法
可让您轻松完成，而不会影响旧站点：

 1. 备份你当前站点的数据库
 2. 在你的新主机中安装数据库
 3. 在新主机上，在 `wp-config.php` 文件中定义新站点 URL，如下所示 [这里](https://codex.wordpress.org/Changing_The_Site_URL#Edit_wp-config.php )
 4. 等你到你的新的admin UR 并且运行 Better Search Replace 在老的站点URL 用于新的URL。
 5. 上一个 下一个链接 删除您添加到 `wp-config.php` 的 site_url 常量。您可能还需要通过
    转到 Settings -> Permalinks 并保存设置来重新生成 .htaccess。

更多的信息你可以通过WordPress来找到 [这里](https://codex.wordpress.org/Moving_WordPress)

## 评价

![](https://secure.gravatar.com/avatar/f0753d30578464954a98a26fa0d8006e0952c670281b55f01fc825222441235d?
s=60&d=retro&r=g)

### 󠀁[Avoid – Replaces all strings with one string](https://wordpress.org/support/topic/avoid-replaces-all-strings-with-one-string/)󠁿

 [accordionmaniac](https://profiles.wordpress.org/accordionmaniac/) 2026 年 5 月
10 日

Replaces all instances of the string, with one instance of the string that it finds
in the database, everywhere. Completely out of your control.

![](https://secure.gravatar.com/avatar/15fb84635c304663ee27a6654ad79fe11052aaa916919870cf4b4fc63f886db3?
s=60&d=retro&r=g)

### 󠀁[Excellent](https://wordpress.org/support/topic/excellent-14240/)󠁿

 [Quentin Le Duff](https://profiles.wordpress.org/quentinldd/) 2026 年 4 月 23 日

Using it for years, doing it’s job well 🙂

![](https://secure.gravatar.com/avatar/7cc1b1116e06b81f5a0e14a1b8eb322ec655b5ff0158280bd1bb077a4283fcc8?
s=60&d=retro&r=g)

### 󠀁[Works But Limited](https://wordpress.org/support/topic/works-but-limited-5/)󠁿

 [urmirun](https://profiles.wordpress.org/urmirun/) 2026 年 3 月 9 日

Used Better Search Replace while moving my site. It did the basic job fine & was
easy to run. But some useful options are locked in Pro, which was a bit annoying.
Still ok for quick replace tasks tho.

![](https://secure.gravatar.com/avatar/36bfda6f4aa6a01bbe2180a2dbfa2157602570d8133b37a8823d688a32454590?
s=60&d=retro&r=g)

### 󠀁[Works Pretty Well](https://wordpress.org/support/topic/works-pretty-well-58/)󠁿

 [hakeemstone](https://profiles.wordpress.org/hakeemstone/) 2026 年 2 月 23 日

Used it to update old URLs after site move. Did the job smooth, no big issue. UI
is simple & easy to get. Saved a lot of time tbh. Would be 5 star if a bit faster
on large DB, but still solid plugin 👍

![](https://secure.gravatar.com/avatar/a50a459b0c94f6c2b570df57c2a789dc7de4cd9db00d5e58665a9561bf0e82c4?
s=60&d=retro&r=g)

### 󠀁[Não utilize isso](https://wordpress.org/support/topic/nao-utilize-isso/)󠁿

 [Juarez Meireles](https://profiles.wordpress.org/juarezjms/) 2026 年 2 月 22 日

Se você não quer passar raiva, fique longe deste plugin. Instalei para somente para
alterar alguns links de saída que haviam em postagens de cupons e produtos Woo. 
Ele realmente fez o trabalho. Troucou. Porém, bagunçou tudo no banco de dados com
coisas que não tinha nada relacionado à estes links.Todos os botões de saída do 
site, independente do url de saída, ficaram com um mesmo url que nunca foi inserido
no plugin. Trocou a descrição de todas as categorias para um mesmo texto que era
o texto de uma das lojas que sou parceiro(dealstore).Se ele alterasse só o que solicitamos,
era maravilhoso. Mas ele alterou foi tudo. O pior é que só percebi 10 dias depois.
Agora é trabalhar vários dias para recuperar os valores reais em diversos campos.
Mas tirando esse bug, o plugin é bom.

![](https://secure.gravatar.com/avatar/617c6e62c889619ef2f92f5ca2ea7bcf0868921649bbcda500259dcc1bc78658?
s=60&d=retro&r=g)

### 󠀁[Very Good tool](https://wordpress.org/support/topic/very-good-tool-104/)󠁿

 [KeithRowley](https://profiles.wordpress.org/keithrowley/) 2026 年 1 月 8 日

I’ve done the job before, migrating a site to a new url. This made the job easier
and presented no false steps or problems. Thank you.

 [ 阅读所有543条评价 ](https://wordpress.org/support/plugin/better-search-replace/reviews/)

## 贡献者及开发者

「Better Search Replace」是开源软件。 以下人员对此插件做出了贡献。

贡献者

 *   [ WP Engine ](https://profiles.wordpress.org/wpengine/)
 *   [ Delicious Brains ](https://profiles.wordpress.org/deliciousbrains/)
 *   [ Matt Shaw ](https://profiles.wordpress.org/mattshaw/)

「Better Search Replace」插件已被翻译至 32 种本地化语言。 感谢[所有译者](https://translate.wordpress.org/projects/wp-plugins/better-search-replace/contributors)
为本插件所做的贡献。

[帮助将「Better Search Replace」翻译成简体中文。](https://translate.wordpress.org/projects/wp-plugins/better-search-replace)

### 对开发感兴趣吗?

您可以[浏览代码](https://plugins.trac.wordpress.org/browser/better-search-replace/)，
查看[SVN仓库](https://plugins.svn.wordpress.org/better-search-replace/)，或通过[RSS](https://plugins.trac.wordpress.org/log/better-search-replace/?limit=100&mode=stop_on_copy&format=rss)
订阅[开发日志](https://plugins.trac.wordpress.org/log/better-search-replace/)。

## 更新日志

#### 1.4.10 – January 14, 2025

 * Fix: Improved security and stability

#### 1.4.9 – October 4, 2024

 * Security: The plugin now uses its own update mechanism from WP Engine servers
 * New: Dependencies have been updated

#### 1.4.8 – September 3, 2024

 * No changes as this was a pro-only release for Better Search Replace Pro

#### 1.4.7 – May 30, 2024

 * Fix: The case-insensitive setting once again allows case-insensitive strings 
   to be matched within serialized data, fixing a regression introduced in version
   1.4.6

#### 1.4.6 – April 17, 2024

 * Changed: Serialized text strings are now only deserialized when containing a 
   match, resulting in faster performance
 * Security: Table names are now escaped when displaying search results

#### 1.4.5 – January 18, 2024

 * Security: Unserializing an object during search and replace operations now passes`'
   allowed_classes' => false` to avoid instantiating the object and potentially 
   running malicious code stored in the database (thanks to Wordfence for responsible
   disclosure on December 18, 2023 followed by development and testing of the fix
   by WP Engine)
 * Fix: A regression in version 1.4.4 which caused some search results to be skipped
   has been fixed to ensure only numeric keyed objects are skipped

#### 1.4.4 – December 14, 2023

 * Fix: Objects with numerical properties are now skipped to avoid causing errors

#### 1.4.3 – September 5, 2023

 * New: Links to plugin documentation, support, feedback, and changelog are now 
   available in the footer of WP Admin
 * Improvement: PHP 8.2 and Better Search Replace are now compatible

#### 1.4.2 – January 11, 2023

 * Security: Arbitrary tab templates in the `templates` directory can no longer 
   be loaded using a query parameter.

#### 1.4.1 – July 25, 2022

 * Security: Selected tables are now confirmed to exist before processing the request

#### 1.4 – April 7, 2022

 * New: Better Search Replace has a brand new user interface
 * Improvement: Default capability required to use the plugin has changed from “
   install_plugins” to “manage_options” for compatibility with DISALLOW_FILE_MODS

#### 1.3.4 – December 7, 2020

 * 提升：WordPress 5.6 以及 PHP 8 兼容性
 * FIX：已序列化两次的字符串显示为假阳性

#### 1.3.3 – February 26, 2019

 * 修复：某些特殊字符干扰 search/replace
 * 安全：通过末班文件`sanitize_file_name()`
 * 安全：当下载诊断信息的时候仅验证一次

#### 1.3.2 – January 3, 2018

 * 修复：再一些换进中仅一个表单搜索 (props @Ov3rfly)
 * 优化：在侧边栏更新文字

#### 1.3.1 – September 14, 2017

 * 安全：检查如果数据在为序列化之前序列化它
 * 优化：增加表格选择的尺寸

#### 1.3 – November 10, 2016

 * 提升：更新sidebar 并且添加Pro 版本折扣
 * 修复：Outdated 链接到老的网站
 * 修复：保留对无效的tab的请求

#### 1.2.10 – June 2, 2016

 * 修复：CSS 没有再详情页加载

#### 1.2.9 – December 8, 2015

 * 修复：序列化对象中搜索大小写敏感的错误
 * 修复：由于缺少主要key而导致的早起跳过

#### 1.2.8 – November 25, 2015

 * 修复：带有报告详情的Bug

#### 1.2.7 – November 24, 2015

 * 修复：未翻译的字符串
 * 优化：检查 BSR_PATH 于 ABSPATH 是否一致
 * 通过4.4进行测试

#### 1.2.6

 * 移除不使用的代码/小的cleanup

#### 1.2.5

 * 优化进度条信息以及风格
 * 小的cleanup

#### 1.2.4

 * 添加 “Setting Saved” 当保存设定注意时
 * 修复了wp_magic_qutes干扰某些搜索字符串的错误

#### 1.2.3

 * 修复了反斜杠中的搜索bug
 * 修复了在大型多站点中获取表的潜在错误
 * 修复了 append_report 中的潜在通知
 * 改进了对丢失主键的处理

#### 1.2.2

 * 修复了与 WooCommerce 的 AJAX 冲突
 * 修复了一些翻译上的问题
 * 调整“系统信息”用于使用get_locale() 代替 WP_LANG 常数
 * 更新了德语的翻译 (props @Linus Ziegenhangen)

#### 1.2.1

 * 修复带有进度条的镜像问题
 * 更新翻译文件

#### 1.2

 * 切换AJAX批量进程用于 Search/Replaces
 * 减少最小的”最大页面尺寸” 到1000
 * 添加”Help” tab 带有系统信息用于简单的问题排除

#### 1.1.1

 * 添加能力能够改变最大的页面尺寸
 * 减少默认页面的尺寸来保留白色屏幕的问题再一些环境中

#### 1.1

 * 添加能够改变
 * 小的bug修复以及翻译修复

#### 1.0.6

 * 添加表单大小到数据库表单列表
 * 添加法语翻译 (props @Jean Philippe)

#### 1.0.5

 * 添加对于大小写敏感的搜索
 * 添加德国翻译 (props @Linus Ziegenhagen)

#### 1.0.4

 * 潜在的安全修复

#### 1.0.3

 * 修复了搜索特殊字符 (如‘\’) 时出现的问题
 * 通过替换一些对象修复bug

#### 1.0.2

 * 修复未能翻译的字符串再提交那妞一级子菜单页面

#### 1.0.1

 * 修复了加载翻译和添加西班牙语翻译的问题 (道具Eduardo Larequi)
 * 通过报告时间修复bug
 * 更新将“试运行”作为默认
 * 添加支持用于WordPress多站点(查看FAQs 了解更多信息)

#### 1.0

 * 初始化发布

## 额外信息

 *  版本 **1.4.10**
 *  最后更新：**6 月前**
 *  活跃安装数量 **超过 1 百万**
 *  WordPress 版本 ** 3.0.1 或更高版本 **
 *  已测试的最高版本为 **6.9.4**
 *  语言
 * [Catalan](https://ca.wordpress.org/plugins/better-search-replace/) 、 [Chinese (China)](https://cn.wordpress.org/plugins/better-search-replace/)、
   [Chinese (Taiwan)](https://tw.wordpress.org/plugins/better-search-replace/) 、
   [Czech](https://cs.wordpress.org/plugins/better-search-replace/) 、 [Danish](https://da.wordpress.org/plugins/better-search-replace/)、
   [Dutch](https://nl.wordpress.org/plugins/better-search-replace/) 、 [Dutch (Belgium)](https://nl-be.wordpress.org/plugins/better-search-replace/)、
   [English (Australia)](https://en-au.wordpress.org/plugins/better-search-replace/)、
   [English (Canada)](https://en-ca.wordpress.org/plugins/better-search-replace/)、
   [English (New Zealand)](https://en-nz.wordpress.org/plugins/better-search-replace/)、
   [English (South Africa)](https://en-za.wordpress.org/plugins/better-search-replace/)、
   [English (UK)](https://en-gb.wordpress.org/plugins/better-search-replace/) 、
   [English (US)](https://wordpress.org/plugins/better-search-replace/) 、 [French (Canada)](https://fr-ca.wordpress.org/plugins/better-search-replace/)、
   [French (France)](https://fr.wordpress.org/plugins/better-search-replace/) 、
   [Galician](https://gl.wordpress.org/plugins/better-search-replace/) 、 [German](https://de.wordpress.org/plugins/better-search-replace/)、
   [Italian](https://it.wordpress.org/plugins/better-search-replace/) 、 [Japanese](https://ja.wordpress.org/plugins/better-search-replace/)、
   [Korean](https://ko.wordpress.org/plugins/better-search-replace/) 、 [Lithuanian](https://lt.wordpress.org/plugins/better-search-replace/)、
   [Norwegian (Bokmål)](https://nb.wordpress.org/plugins/better-search-replace/)、
   [Persian](https://fa.wordpress.org/plugins/better-search-replace/) 、 [Polish](https://pl.wordpress.org/plugins/better-search-replace/)、
   [Portuguese (Brazil)](https://br.wordpress.org/plugins/better-search-replace/)、
   [Russian](https://ru.wordpress.org/plugins/better-search-replace/) 、 [Spanish (Chile)](https://cl.wordpress.org/plugins/better-search-replace/)、
   [Spanish (Colombia)](https://es-co.wordpress.org/plugins/better-search-replace/)、
   [Spanish (Ecuador)](https://es-ec.wordpress.org/plugins/better-search-replace/)、
   [Spanish (Spain)](https://es.wordpress.org/plugins/better-search-replace/) 、
   [Spanish (Venezuela)](https://ve.wordpress.org/plugins/better-search-replace/)、
   [Swedish](https://sv.wordpress.org/plugins/better-search-replace/) 和 [Ukrainian](https://uk.wordpress.org/plugins/better-search-replace/).
 *  [翻译成简体中文](https://translate.wordpress.org/projects/wp-plugins/better-search-replace)
 * 标签
 * [search and replace](https://cn.wordpress.org/plugins/tags/search-and-replace/)
   [search replace](https://cn.wordpress.org/plugins/tags/search-replace/)[search replace database](https://cn.wordpress.org/plugins/tags/search-replace-database/)
   [update database urls](https://cn.wordpress.org/plugins/tags/update-database-urls/)
   [update live url](https://cn.wordpress.org/plugins/tags/update-live-url/)
 *  [高级视图](https://cn.wordpress.org/plugins/better-search-replace/advanced/)

## 评级

 4.3 星（最高 5 星）。

 *  [  431 条 5 星评价     ](https://wordpress.org/support/plugin/better-search-replace/reviews/?filter=5)
 *  [  15 条 4 星评价     ](https://wordpress.org/support/plugin/better-search-replace/reviews/?filter=4)
 *  [  11 条 3 星评价     ](https://wordpress.org/support/plugin/better-search-replace/reviews/?filter=3)
 *  [  17 条 2 星评价     ](https://wordpress.org/support/plugin/better-search-replace/reviews/?filter=2)
 *  [  69 条 1 星评价     ](https://wordpress.org/support/plugin/better-search-replace/reviews/?filter=1)

[Your review](https://wordpress.org/support/plugin/better-search-replace/reviews/#new-post)

[查看全部评论](https://wordpress.org/support/plugin/better-search-replace/reviews/)

## 贡献者

 *   [ WP Engine ](https://profiles.wordpress.org/wpengine/)
 *   [ Delicious Brains ](https://profiles.wordpress.org/deliciousbrains/)
 *   [ Matt Shaw ](https://profiles.wordpress.org/mattshaw/)

## 支持

最近两个月解决的问题：

     总计 5，已解决 3

 [查看支持论坛](https://wordpress.org/support/plugin/better-search-replace/)