Changing URLs in phpmyadmin

Discussion in 'Databases' started by mtone, Feb 6, 2008.

  1. #1
    Hi, I'm wondering if anyone can help me with my problem. I'm currently trying to move a wordpress account into my godaddy account. I am following the steps in this link

    Now, there's a paragraph on the middle which says "If links to pages or images or other files in your blog entries had fully qualified URLs (for example, http://www.marialanger.com/wp-content/images/picture.jpg) rather than relative URLs (such as /wp-content/images/picture.jpg for content within the blog and you now have a new domain name, you’ll have to manually change all the URLs so they point to the correct domain name. Not fun, I know. You might be able to do a global change using phpMyAdmin, but please don’t ask me how. I don’t know."

    I know my blog has qualified URLs instead of relative URLs. Does anyone know how I can edit my database in phpmyadmin to tell my wordpress blog to use relative URLs? Thanks.
     
    mtone, Feb 6, 2008 IP
  2. ColinPL

    ColinPL Peon

    Messages:
    27
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    UPDATE wp_posts SET post_content = REPLACE(post_content, 'href="http://www.yourdomain.com/', 'href="/');
    UPDATE wp_posts SET post_content = REPLACE(post_content, 'src="http://www.yourdomain.com/', 'src="/');
    
    Code (markup):
    This will change all links in blog posts from http://www.yourdomain.com/directory/file to /directory/file.
     
    ColinPL, Feb 7, 2008 IP