如何使用插件在WordPress中进行搜索和替换

Are you looking to do search and replace in WordPress? Recently, one of our users asked us how to run search and replace on WordPress database without writing any SQL code or using phpMyAdmin. Many beginners are not comfortable with code, so that’s why we found a search and replace plugin for WordPress. In this article, we will show you how to do search and replace in WordPress.

您是否要在WordPress中进行搜索和替换? 最近,我们的一位用户问我们如何在WordPress数据库上运行搜索和替换,而无需编写任何SQL代码或使用phpMyAdmin。 许多初学者对代码不满意,所以这就是为什么我们找到了WordPress的搜索和替换插件。 在本文中,我们将向您展示如何在WordPress中进行搜索和替换。

Search and replace text in WordPress database
入门 (Getting Started)

It is extremely important that you create a complete WordPress backup before making any changes to your WordPress database.

在对WordPress数据库进行任何更改之前,创建完整的WordPress备份非常重要。

Make this best practice a habit, things can go wrong anytime when you are making direct changes to the WordPress database. If you have a backup, then you can easily restore your WordPress site without losing anything.

养成这种最佳做法的习惯,直接更改WordPress数据库时,随时都有可能出错。 如果您有备份,则可以轻松恢复WordPress网站而不会丢失任何内容。

安装和使用更好的WordPress搜索和替换 (Installing and Using Better Search and Replace for WordPress)

First thing you need to do is install and activate the Better Search Replace plugin. Upon activation, you need to visit Tools » Better Search Replace page to use the plugin.

您需要做的第一件事是安装并激活Better Search Replace插件。 激活后,您需要访问工具»更好的搜索替换页面以使用该插件。

Better search replace plugin settings

Simply add the text string you want to search for and then add the replace text.

只需添加您要搜索的文本字符串,然后添加替换文本。

After that you need to select the tables you want to look into. For example, if you want to search and replace some text in your posts then you may want to select the posts table. You can also select multiple tables if you want.

之后,您需要选择要查看的表。 例如,如果您要搜索和替换帖子中的某些文本,则可能要选择帖子表。 您还可以根据需要选择多个表。

Learn more about WordPress database management and what each table does in WordPress.

详细了解WordPress数据库管理以及每个表在WordPress中的作用。

The plugin can run a case sensitive search and replace. It can also perform a dry run which allows you to see how many cells are affected by your search without actually replacing the text.

该插件可以运行区分大小写的搜索和替换。 它还可以执行试运行,使您无需实际替换文本即可查看有多少个单元格受到搜索的影响。

When you are satisfied, click on run search/replace button. If you did not check the dry run option, then the plugin will now run search and replace on your WordPress database.

如果满意,请单击“运行搜索/替换”按钮。 如果您未选中空运行选项,则该插件现在将在您的WordPress数据库上运行搜索并替换。

故障排除 (Troubleshooting)

You may see the white screen or run into timeouts while performing a search and replace. Simply click on the settings tab under the plugin page.

执行搜索和替换时,您可能会看到白屏或超时。 只需单击插件页面下的设置选项卡。

Troubleshooting timeouts during search and replace

You will notice the max page size option. Try decreasing the page size to avoid timeouts and white screen.

您会注意到“最大页面大小”选项。 尝试减小页面大小,以避免超时和白屏。

That’s all, we hope this article helped you find a better search and replace plugin for WordPress database. You may also want to see our tutorial on how to clean up your WordPress database for improved performance.

仅此而已,我们希望本文能帮助您找到更好的WordPress数据库搜索和替换插件。 您可能还想看一下有关如何清理WordPress数据库以提高性能的教程。

If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.

如果您喜欢这篇文章,请订阅我们的YouTube频道 WordPress视频教程。 您也可以在TwitterFacebook上找到我们。

翻译自: https://www.wpbeginner.com/plugins/search-and-replace-plugin-for-wordpress-database/

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值