(http://localhost:8080/Demo
) with a new live URL (http://Demo.com
).
- The first query updates the
home
andsiteurl
options in thewp_options
table to reflect the new URL, ensuring the site directs users to the correct address. - The second query modifies the
guid
values in thewp_posts
table, which are unique identifiers for posts, ensuring they point to the new URL. - The third query updates the
post_content
in thewp_posts
table to replace any occurrences of the old URL within the content of posts, ensuring that all links and media references are accurate. - The fourth query updates the
meta_value
in thewp_postmeta
table to replace the old URL in any custom fields or metadata associated with posts.
UPDATE wp_options SET option_value = replace(option_value, 'http://localhost:8080/Demo', 'http://Demo.com') WHERE option_name = 'home' OR option_name = 'siteurl';
UPDATE wp_posts SET guid = replace(guid, 'http://localhost:8080/Demo','http://Demo.com');
UPDATE wp_posts SET post_content = replace(post_content, 'http://localhost:8080/Demo', 'http://Demo.com');
UPDATE wp_postmeta SET meta_value = replace(meta_value,'http://localhost:8080/Demo','http://Demo.com');
Leave a comment