S0metimes, you start your wordpress website in your localhost. All posts and url's are created with your url. When deploying your application, the url must be updated to the new host.
This queries update the wordpress url to a new url.
| UPDATE wp_options SET option_value = 'https://my-new-website' WHERE option_name = 'siteurl'; | |
| UPDATE wp_options SET option_value = 'https://my-new-website' WHERE option_name = 'home'; | |
| UPDATE wp_posts SET guid = REPLACE (guid, 'http://localhost/my-old-website','https://my-new-website') | |
| UPDATE wp_posts SET post_content = REPLACE (post_content, 'http://localhost/my-old-website', 'http://localhost/my-new-website'); | |
| UPDATE wp_postmeta SET meta_value = REPLACE (meta_value, 'http://localhost/my-old-website', 'https://my-new-website'); |