Support » Localhost Installs » images not to use static link

  • i have images stored in uploads and the person developed the site has images following full links and i want to insted use path.

    here is the code i have in the page when i switch to Text view.

    [frame link=”” linking=”lightbox” align=”left” type=”simple”][flex_slider width=”614″ ]

    and my site will be at some point and i dont want to go in each page and change that static link.
    anyway to make it so that whatever links i have on devlopment server when i upload it points to the correct file.

Viewing 2 replies - 1 through 2 (of 2 total)
  • I’m not sure if this will help but If you know some SQL you could do that:
    Open phpMyAdmin on your server (live or local), and export the database, making sure to select all tables and to save it as a file. Go to your live server, and import the .sql file that you just saved. In the top menu, click on the tab for “SQL,” whereupon you will see a text area. You will need to enter some query syntax; be sure to replace the URLs in these code fragments with the ones that pertain to your set-up — namely.

    Replacing WordPress’ base URL path:
    UPDATE wp_options SET option_value = replace(option_value, 'http:// localhost:8888/wordpress ', '') WHERE option_name = 'home' OR option_name = 'siteurl';
    Update the GUID that controls WordPress’ translating paths and post locations:
    UPDATE wp_posts SET guid = REPLACE (guid, 'http://localhost:8888/ wordpress ', '');
    Update the URL paths in the content:
    UPDATE wp_posts SET post_content = REPLACE (post_content, 'http:// localhost:8888/wordpress ', '');
    Update the URLs in the meta data of posts, such as attachments:
    UPDATE wp_postmeta SET meta_value = REPLACE (meta_value, 'http:// localhost:8888/wordpress ','');

    If this doesn’t work for you or is too complicated, I’ve read that somewhere:

    I use this method if I have done everything locally from the ground up. I’ll upload my entire local WordPress directory (in this case, http:// localhost:8888/wordpress) to the live server and then grab the database file and transfer that from local to live as well.
    Because you could certainly build nearly the entire website in your development environment, bear in mind that WordPress uses absolute paths for URLs. So, every image and link will be prepended with http:// localhost:8888/ (depending on your set-up). We need a way to alter this to fit the live website. We have a few options.
    Using this method, we export our local database as a text file and run a “Find and replace” on the text to replace all occurrences of the localhost URL with the production URL.
    Begin by opening phpMyAdmin and clicking on your WordPress database on the left. Click on the “Export” tab in the top menu, and be sure to choose “Select all” when choosing which tables to export. At the bottom, check the box to “Save as file,” and then hit “Go.” Open the resulting file in your favorite text editor, and simply run a “Find and replace” to replace all instances of http://localhost:8888/wordpress with http://

    This is taken from WordPress essentials for beginners, Ebook by Smashing Magazine

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘images not to use static link’ is closed to new replies.