60
loading...
This website collects cookies to deliver better user experience
If you want to learn more about WordPress you can check this awesome course Building websites with WordPress by Nat Miletic. This course is excellent for those who want to start with WordPress. But it is also for those who have experience, and this course can be used as a reminder of some WordPress functionalities.
Affiliated link
UPDATE wp_options SET option_value = replace(option_value, 'https://www.oldurl', 'https://www.newurl') WHERE option_name = 'home' OR option_name = 'siteurl';
UPDATE wp_posts SET guid = replace(guid, 'https://www.oldurl','https://www.newurl');
UPDATE wp_posts SET post_content = replace(post_content, 'https://www.oldurl', 'https://www.newurl');
UPDATE wp_postmeta SET meta_value = replace(meta_value, 'https://www.oldurl','https://www.newurl');
username@[~/Desktop]: mysql -u root -p databasename
Enter password:
Type 'help;' or 'h' for help. Type 'c' to clear the current input statement.
mysql> UPDATE wp_options SET option_value = replace(option_value, 'https://www.oldurl', 'https://www.newurl') WHERE option_name = 'home' OR option_name = 'siteurl';
Query OK, 2 rows affected (0.00 sec)
Rows matched: 2 Changed: 0 Warnings: 0
mysql> UPDATE wp_posts SET guid = replace(guid, 'https://www.oldurl','https://www.newurl');
Query OK, 1236 rows affected (0.01 sec)
Rows matched: 1236 Changed: 0 Warnings: 0
mysql> UPDATE wp_posts SET post_content = replace(post_content, 'https://www.oldurl', 'https://www.newurl');
Query OK, 1236 rows affected (0.05 sec)
Rows matched: 1236 Changed: 0 Warnings: 0
mysql> UPDATE wp_postmeta SET meta_value = replace(meta_value, 'https://www.oldurl','https://www.newurl');g
Query OK, 999 rows affected (0.01 sec)
Rows matched: 999 Changed: 0 Warnings: 0