🚀 Is building a website too difficult? Let me guide you step by step—Learn about the 「Naibabiji WordPress Website Building Coaching Service」 →

WordPress Batch Find and Replace Plugin and Code for Modifying Article Content

I've modified the permanent links for some articles on the site. Is there a wayto modify all related links on the site? The answer is yes.For batch replacing the WordPress database, we can adopt the following two methods
  1. Bulk Replace Using Plugins
  2. Bulk Replace Using Database Commands

Replacement Method 1: Using the Better Search Replace plugin

Better Search Replaceis a tool for batch searching and replacing in the databaseWordPress Plugin. The plugin is in English, but it's very simple to use. The specific steps are as follows:WordPress批量查找替换修改文章内容的插件和代码
  • Enter the content you want to search for in 'Search for'
  • Enter the content you want to replace with in 'Replace with'
  • Select the tables to search and replace in 'Select tables'. The WordPress posts table is wp_posts
  • 'Case-Insensitive?' determines whether to be case-sensitive
  • 'Replace GUIDs' refers to the GUID which is the website domain. Generally, do not select this.
  • 'Run as dry run?' If checked, it won't write directly to the database; it will only show you how many changes would be made. To actually make the changes, uncheck this.
Take a simple example. For example, if your old article URL was https://blog.naibabiji.com/archives/*.html and the new URL structure is https://blog.naibabiji.com/skill/*.html, then you just need to fill in '/archives/' in 'Search for' and '/ji-qiao/' in 'Replace with'.Official Download Cloud Storage Download

Replacement Method 2: Using code to replace in the database

This method requires accessing the database via phpMyAdmin. If you are not familiar with database operations, it is recommended to use the plugin method described in Method 1. The implementation is the same; this one uses commands while the plugin uses a graphical interface. After opening phpMyAdmin, enter your website's database and execute the following SQL code.
UPDATE wp_posts SET post_content = REPLACE(post_content, '原内容' , '替换为的内容');
WordPress Bulk Content ReplacementIt is commonly used when we have changed the website URL structure, or when you modify the URL of an important article and need to batch update links referencing that URL in other articles. However, URLs written directly into the website's theme template files cannot be replaced this way; only data within the database can be replaced using the methods above. For safety, it is recommended to back up the database before performing any replacements.Backing Up WordPress Using Plugins

More Methods for Batch Processing WordPress Data

If you need to batch clear articles under a WordPress category, featured images, media library data, etc., please refer to the tutorial article below:

🚀 Still feeling confused after reading the tutorial? Let me guide you step-by-step.

「Naibabiji WordPress Website Building Coaching Service」—From choosing a domain and buying hosting, to installing a Theme and publishing content, I「ll coach you through every step, helping you avoid detours and reach your goal directly.

👉 Learn about the Website Building Coaching Service
🔒

Comments are closed

The comment function for this article is closed. If you have any questions, please feel free to contact us through other channels.

×
二维码

Scan QR Code to Follow

AI Website Building Assistant

🤖
Hello! I am the Naibabiji AI Assistant. How can I help you?
Quick Consultation: