I coudn’t solve it with a plugin or plain SQL, see this other question. Instead I exported all the posts with Tools > Data export > WordPress and deleted the posts. Then I run this python script over the exported XML file and imported the update xml file again. Tadaa…
import re
p = re.compile(r'http://([^/]*)/getfile/files.posterous.com/([^/]*)/([^/]*)/([^/]*)')
f1 = open('input.xml', 'r')
f2 = open('output.xml', 'w')
for line in f1:
f2.write(p.sub(r'http://my.domain.com/wordpress/wp-content/uploads/legacy/\4', line))
f1.close()
f2.close()
Related Posts:
- How do I get the avatar URL instead of an HTML IMG tag when using get_avatar?
- Programmatically get images by URL and save in uploads folder
- Function to get URL of original uploaded image – full size
- How to reference a theme image in a stylesheet?
- Mixed content warnings after changing site adress from HTTP to HTTPS
- Preview Image Path in Admin Section
- Why would image paths in wordpress suddenly change?
- Remove the http protocol from images
- How do i reference the theme path in pages for images?
- @wordpress/create-block image url in css
- WordPress url image redirect to the homepage
- Broken urls with http site and https wp-admin
- A way to change image urls in post to cdn image url?
- How to change image url?
- Update image links in database
- Shortcode for a link and thumbnail
- media_sideload_image with rewritten urls?
- How to add an image to a custom url?
- images not showing after transfer
- Change media URL (images)
- How to redirect homepage to actual URL?
- Clicks registering on Preview DNS site
- Is it possible to enable the ‘Link To’ field under ‘Attachment Display Settings’ for a Featured Image?
- Using a .pdf file as a page in wordpress
- How to get image URL from media_sideload_image?
- Exclude image url from search query
- Redirect Image Url to a page via htaccess
- How to pass on a value as parameter via url to another page
- How to replace post image url before posting using api?
- Hide or mask the url to an image
- Glitched page redirects to image
- i want to change URL of WordPress image or rewrite in runtime
- How to show a full page when someone links directly to an image on my site
- Bypass wp_safe_remote_get()?
- Which tools should I use for a gallery that uses an API and url for the path of the images?
- List sub pages with custom field content converting image ID to URL
- Change the image for a certain URL
- Setting name of attachment URL
- Protocol relative url not pulling up images on IE, FF, and OPERA
- Broken image URL
- How do I mitigate the forward slash problem for URLs of images after a WP migration?
- Images in sub-pages fail to load
- get_post_custom: get image URL instead of image ID
- Are image addresses security relevant?
- Remote Image (from URL) as Media Library element
- WPALLIMPORT Exporting images from repeater field [closed]
- Remove P tags from images
- Any easy way to automatically set the first inline image in a post as the thumbnail?
- Upload multiple images in a custom metabox
- How can I hide media library images from general users?
- WordPress speed slow after .5 million single image post via wp-cli
- How to add php to theme to show alt attributes
- Why won’t these imported images show up?
- Remove rel=”attachment wp-att-XX”
- Using Taxonomy Image code with my get_categories code
- Rename image during upload using date and time stamp?
- Upload thousands of images to WordPress without plugin?
- Images in the Twenty Fourteen theme
- Why are images created by WP larger than the original uploaded image?
- Scaling images for mobile
- How do I fix “Sorry, this file type is not permitted for security reasons”
- Image LazyLoad plugin not loading jQuery dependancies with wp_enqueue_script in WP 3.3.1
- How to make thumbnails of uploaded animated gifs NOT animated
- Frontend Image Upload
- Multiple variables through wp_get_image_editor
- Rewrite inline image markup
- URL through custom field returning null
- big trouble with javascript
- Display cropped thumbnail not featured image
- Hide image gallery in Woocommerce if NO image [closed]
- All 3?: Responsive resizing of images + image width of actual image for small images + max-width for all larger images
- How to get the cropped image from media library?
- wordpress makes duplicate images of different size
- Responsive Images from S3 has no srcset
- The URL of images on my website changed after being set as featured image
- How to only show div of caption if caption exists on featured image
- How to “lazy load” post thumbnail
- Landing Page with HTML CSS JS and Images on wordpress
- Change Image URL on upload to some random number automatically
- Image title replace with current date
- WordPress Responsive Image ( srcset ) not work properly
- Product Gallery Images to go into full size on Product Page
- Why does wp_get_attachment_image_src return the wrong size, when the correct size exists?
- Responsive Images in WordPress
- Is it possible to remove spaces from existing images? [closed]
- Get image from one page and show/add it on another page
- Featured image on page set as “Posts page” in Settings > Reading
- problem with updating metabox of upload image
- Adding Image Description below Images Inserted into Posts
- Display ajax preloader for large images within posts
- Insert image doesn’t pickup right size
- Images will not attach to posts after site migration
- Stop underlining image links
- How to get attached image alt text in media.php?
- Why some images are not allowed to be edited only for thumbnails?
- problems with alt text not appearing in source code
- WordPress Theme: replace logo image with title site if file doesn´t exist on server
- WordPress update leads to 404 error on admin page and signup. CSS mishap with all plugin related functions
- How to get dimension of Logo and Crest
- WordPress Missing Images