Support » Fixing WordPress » Changing blog address messes up uploads URLs

  • Resolved heriz


    Okay, this is what I wanted to do.

    My current blog site is here:

    I wanted to rename it to /legroom

    (I have my reasons.)

    I tried, using the Codex, the support threads (of which there is a lot on this subject) etc etc.

    It was fine, apart from the fact that all my links to my uploads were now broken, and the files themselves had the old path associated with them. From this I’m guessing:

    – You cannot change the blog url without having to manually change the links in each post

    – You cannot change the blog url and link to uploads directly

    I very much doubt this is the case, but I cannot find ONE thread/Codex post about this specific problem.

    My second problem:

    I decided to lump it and change back. I took all the same steps.

    Now (as you can see) my index page works, but none of my other pages can be found. They are there – my control panel says so.

    Any ideas on what’s happened here?

    And please: be gentle. (Moshu, I’m looking at you.)


Viewing 9 replies - 1 through 9 (of 9 total)
  • Ah – so this is a permalink problem.

    It works (as it is now) using the ugly format, but even if I update my .htaccess file once I’ve reset it to the format I want, it stops working again. Doesn’t look like a very serious problem though.

    I’m still confused about how you’re meant to change the address of your blog when you have a large number of uploads though. Hmm.

    And the permalink problem is solved by changing the .htaccess permissions.

    My first query still stands though: How do you stop the upload links breaking when renaming your WP directory? If anyone knows, it’d be great to find out.

    It is of course quite possible that I was doing something wrong!

    Hello hello,

    Thought I’d update this post.

    I’ve now moved the whole WordPress site to my root directory.

    I knew I’d have the same problem again, but I was following the Codex which links to this (very useful but apparently unrelated) site when discussing problems with broken image links, and thought it’d give me the answer. But there’s nothing in it as far as I can see that refers to the problem of broken image links – unless the reference is there as a subtle way of saying ‘edit the whole lot on your locally-held database, then update’.

    I’ve gone into my SQL database and tentatively tried changing the paths, but in the media library, nothing changes. I have to change the URL in each post in the control panel before images start reappearing.

    I’m up for manually changing the paths to each image, but I want to know that I’m doing it correctly and in the correct place before I blitz the whole thing.

    I’ve done many searches and I think answers would be helpful to others too… any pointers will be much, much appreciated.



    After a few Google searches I found this help page on My Digital Life. Down the page it gives some SQL UPDATE commands which you must run in the SQL section of your mySQL panel once you’ve moved your site.

    I’ve just performed the operation and everything is fixed.

    Maybe this page should be linked in the Codex page rather than the current one?

    Thanks for the info.

    With WP2.5 I updated the new blog link in Settings, FTP transferred the directory, then ran these SQL commands:
    UPDATE wp_posts SET guid = replace(guid,’’,’’);
    UPDATE wp_posts SET post_content = replace(post_content,’’,’’);

    Thanks for the link, I found the other one to be useless as well, this one was easy and saved my butt. 🙂

    I always used this plugin:

    recommended for those that are not fluent in sql commands…



    Wow, heriz, you’re like your own tech support up there – good job! I just migrated a non-live WP on my localhost to a[n almost] live place on the web and was devastated, thinking I’d have to re-upload all my pictures again. Your link worked great, and therefore won’t hold that /legroom thing against you 🙂

    Thanks again to you, jg and moshu for the helpful tips; I owe all you guys a beer. You’re invited too, redheadedninja, I’m in a very good mood right now.

    Thanks Heriz.
    Had been treading much the same path as you when I can across your post and the link to that very useful info.

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Changing blog address messes up uploads URLs’ is closed to new replies.