Home Mysql Replace Text in Post Topic via MySQL Database in WordPress

Replace Text in Post Topic via MySQL Database in WordPress

32
0

Most wordpress users find Elive Net. It is difficult to replace a single word in thousands of posts, so let me make it simple for you all so that you can save your time and finish it in a short moment. The fastest way to replace text in WordPress is PHP Mysql, and it provides the fastest server. Today, I will help you by teaching you how to replace a line or sentence or a word via a simple query.

Why a user required this type of Query?

1. Massive import of topics from other blogs

2. Migration from one domain to another with the same data files

3. By default, you have placed an automatic keyword to the post topic.

Warning:- Some precautions you need to keep backup of the database before running this query might make corruption in the Database.

Let me begin with the process:-

Step 1. If you can access Cpanel, then go to Cpanel, then Msql Database

Step 2. Select your Database

Step 3. Select SQL option on the upper side

msql

Step 4. Now in the box, put the below Words to search and replace:-

UPDATE wp_posts SET post_content = REPLACE (
post_content,
'Item to replace here',
'Replacement text here');

Explanation:-

wp_posts = Posts data
It would be best if you replaced:- Item to replace here with your desired word or words
It would be best if you replaced:- Replacement text here, which will override the previous word

Similarly, If you want to replace the title, then you can run the following query:-

UPDATE wp_posts SET post_title = REPLACE (
post_title,
'Item to replace here',
'Replacement text here');

Thats It, Now check your Posts as it removes the Words!