Support » Plugins » Search & Replace hack

  • lunadust


    Hi I’ve been searching the Support Forum but don’t seem to be able to find a hack to search and replace. Reason is my old links were absolute (i.e. but I replace all the old links with relative path links (i.e. 1.jpg). Any ideas?

Viewing 5 replies - 1 through 5 (of 5 total)
  • This would need you to run an sql query to do all the search/replace for you.



    I had this problem when I moved my website from a subdomain to a top level domain.
    What I did was:
    Exported my database with phpMyAdmin (adding drop tables helps)
    Used find/replace in notepad to replace all of to
    Saved as a new file to keep my old database backed up just incase 🙂
    Used phpMyAdmin to import the modified sql file

    Is there anyone who can post the layout of such a query?
    I have on my site a lot of links to images on another server, since moving the site from a blogger-site hosted in a sub folder.
    and I want those links to look like this:
    I. e. I want to change all occurrences of:
    or better yet, just to point to my site root.

    Found this and it worked great:

    Searching and replacing within phpMyAdmin

    It’s basically this code in PHP MyAdmin, click SQL:

    update 01_posts set post_content = REPLACE(post_content, "what I want to replace", "the replacement text");

    I use numbers “01” instead of “wp” for my multiple installs, so make sure to change that prefix to the tables in question.

    thanks for that! I needed a way to change the url from some remote hosted images to some locally hosted and this did the trick.
    it’s a shame there isn’t a mass search and replace plugin , or more likey it’s a shame I couldn’t find it! but now I now how to run queries on myphp so not a bad result.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Search & Replace hack’ is closed to new replies.