• I developed my site using a subdomain so I wouldn’t affect the live site:
    So in my WordPress URL and Site URL I have: dev.mysite.com

    I went live yesterday and changed the WordPress and Site URL to mysite.com

    The problem I have is the links to photos, etc are still pointing to dev.mysite.com and now these photos do not show.

    I check the php wp-options table and the variables ‘site’ and ‘home’ are set to mysite.com

    Do I have to change these links manually on each page/post?

    Thanks for the help! Dan

Viewing 6 replies - 1 through 6 (of 6 total)
  • Thread Starter mac2025

    (@mac2025)

    Thanks you for your reply. After reading the post I see the following:

    –> Existing image/media links uploaded media will refer to the old folder and must be updated with the new location.

    Do I need to do this manually on each page/post. Is their an automated way.

    Thanks for your help!

    Dan

    You can do that in database backup database if you have not done a back

    UPDATE wp_posts SET guid =
    replace(guid, 'https://www.old-domain.com','https://www.new-domain.com');

    Put above code in Sql tab in database and change the urls to your urls and press Go

    this will change urls in posts and pages.

    If you have links internally within blog posts or pages with absolute URLs, these links need to be changed else they will point to wrong page Use the following SQL commands to fix all internal links to own blog in all WordPress posts and pages:

    UPDATE wp_posts SET post_content = replace(post_content,
     'https://www.old-domain.com', 'https://www.new-domain.com');

    Press Go

    Thread Starter mac2025

    (@mac2025)

    Thanks! I’ll give that a try.

    Just curious, is there a way to have WordPress use Relative links instead of Absolute links when using the “Add Media” button on Posts and Pages?

    Thank you
    Dan

    No. Relative urls do not work well in WordPress.

    Thread Starter mac2025

    (@mac2025)

    Thanks govpatel and esmi for your help!

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Site URL Name Change’ is closed to new replies.