WordPress.org

Ready to get started?Download WordPress

Forums

Image paths (9 posts)

  1. megharah
    Member
    Posted 6 years ago #

    hi,

    Recently, i've moved one of my blogs to another url, and when i did that, i've noticed all the images i've uploaded with the image gallery, was not visible, because the uploader does this: src="http://mysite.com/wp-content/uploads/april/..".. so at the moment i've changed the url, i have to go back and change the src one by one...

    Before wordpress 2.5 i was uploading every image as src="../images/nameofthephoto.jpg" wich is more friendly in case you have to move your blog. Im so happy with the image uploader in 2.5, but i wonder if i can change the way it links the images to something like i was using, without getting the whole url...

    Any ideas?

    Thanks

  2. stvwlf
    Member
    Posted 6 years ago #

    you can run a SQL query on your database to change all occurances of

    http://olddomain.com to http://newdomain.com

    look at this page:
    http://codex.wordpress.org/Changing_The_Site_URL

    The only part of that page relevant to you at this point is
    2. Database Entries
    It contains the instructions for how to change all the links using one query. (My suggestion assumes the location of your images is still the same as it was on the old blog, except on a different domain. That is, they are still the in same folder locations in relation to the rest of your WP installation)

    The other part of that page that is quite relevant is:
    BACK UP YOUR DATABASE before you even think about doing this!!!!

  3. megharah
    Member
    Posted 6 years ago #

    thank you, but i was asking if there is a way to force the image uploader to do the linking without the url, or to change the default path where and how uploads the images, to the a folder called images or photos on the root of the server...

    all the links are already changed, so that doesn't really matters, im only worried about future uploads

    Thanks :D

  4. megharah
    Member
    Posted 6 years ago #

    bump

  5. discojing
    Member
    Posted 6 years ago #

    yep, you can change the default path

    settings > misc > Uploading section

  6. megharah
    Member
    Posted 6 years ago #

    discojing>

    Woa... so simple, im almost ashamed.. LOL, thanks a lot :D

    Now, the thing is, in the post, the image still is called as

    <src="http://www.mysite.com/photos/photo.jpg" />

    so i guess it could be solved by deleting the url each time, but maybe there is a way that WP do the src's like this by default:

    <src="../photos/photo.jpg" />

    *Crossing my fingers for someone with the solution*

    Thanks!!

  7. megharah
    Member
    Posted 6 years ago #

    bump

  8. discojing
    Member
    Posted 6 years ago #

    um, I think you might have to change each post.
    Or maybe try opening the post and then saving it to see if Wp auto changes it? Other than that, try doing something with the image library (i'm unfamiliar with 2.5.1's media library) so, good luck!

    sometimes, you just gotta do everything ALL over (hopefully thats not the case though)

  9. vg_dog
    Member
    Posted 5 years ago #

    I am having the same issue and don't want to re-upload all my images. They are in the correct folders -just linking to my old domain. Don't know what to do.

Topic Closed

This topic has been closed to new replies.

About this Topic