How to find and change a word in sql

aior

Administrator
Staff member
Joined
Apr 2, 2023
Messages
68
Reaction score
0
Points
6
Age
38
Location
Turkey
Website
aior.com
You can see the SQL code How to find and change a word in sql as below:

SQL does not support list and search all tables then if you are using a Wordpress table you can make necessary changes as below:



SQL:
-- wp_options 
UPDATE wp_options
SET option_value = REPLACE(option_value, 'boxpressingmachinery', 'therigidboxmachine')
WHERE option_value LIKE '%boxpressingmachinery%';

-- wp_users 
UPDATE wp_users
SET user_email = REPLACE(user_email, 'boxpressingmachinery', 'therigidboxmachine')
WHERE user_email LIKE '%boxpressingmachinery%';

UPDATE wp_users
SET user_nicename = REPLACE(user_nicename, 'boxpressingmachinery', 'therigidboxmachine')
WHERE user_nicename LIKE '%boxpressingmachinery%';

UPDATE wp_users
SET user_url = REPLACE(user_url, 'boxpressingmachinery', 'therigidboxmachine')
WHERE user_url LIKE '%boxpressingmachinery%';

UPDATE wp_users
SET display_name = REPLACE(display_name, 'boxpressingmachinery', 'therigidboxmachine')
WHERE display_name LIKE '%boxpressingmachinery%';
 
Last edited:
Top