Twenty Twelve
[resolved] Change posts image directory from "wordpress/wp-content/" (4 posts)

  1. shortysbest
    Posted 2 years ago #

    I am having an issue with my wordpress post images. (I am new to wordpress, also).

    My wordpress installed in a folder called, "wordpress" I however changed it to "blog" (and changed the two links in settings to "blog". Everything is working fine, except for some images in my wordpress blogs are not showing up because they are still trying to load from "www.mysite.com/wordpress/wp-content/" when they need to load from "www.mysite.com/blog/wp-content/".

    Now it's odd because certain post images (The large ones it appears) are loading from the correct path, just not the small images.

  2. CFS
    Posted 2 years ago #


    It is possible that your WordPress theme has image links which are hardcoded to use the old URL. Open your WordPress theme in an editor and search for /wordpress and replace it with /blog.

    Another possibility is that your database still contains the old image URLs.

    If you have access to a database editor such as phpMyAdmin, you can update the URLs as explained here: http://www.refreshinglyblue.com/2009/03/29/wordpress-uploaded-images-how-to-change-absolute-url/

    You can try the following two SQL statements:

    UPDATE wp_posts set post_content=REPLACE(post_content, 'www.yoursite.com/wordpress/', 'www.yoursite.com/blog');

    UPDATE wp_posts set post_content=REPLACE(post_content, 'wordpress/wp-content', 'blog/wp-content');

    The Search and Replace plugin may be useful as well: http://wordpress.org/extend/plugins/search-and-replace/

    Remember to have a backup of the database before making any changes!

    Please let us know if that worked out for you!

  3. shortysbest
    Posted 2 years ago #

    Hey CFS,

    Thank you. I had tried everything you had said before (I had spent probably 3-4 hours looking through the files and didn't find anything), but it was hardcoded in the database post... I can't believe I hadn't checked that.. but thanks!!

  4. CFS
    Posted 2 years ago #

    My pleasure :-)

Topic Closed

This topic has been closed to new replies.

About this Theme

About this Topic