Movable Type text replacement script?
June 5, 2012 9:36 AM Subscribe
Any Movable Type experts out there know of a script, or add-on, to make a simple, blog-wide text replacement?
When I originally set up my Movable Type blog, all the files were in the root directory of my Web server. Now that I've moved everything into a blog/ directory, the blog mostly works fine (clicking around the categories, making new posts, etc.), but there's a problem with the text inside the posts.
Specifically, for all the old posts that embedded an image, the HTML references the image in its old location, in the root directory. I need to go through Movable Type to change all those references to refer to the images in the new place - just adding a "blog/" to the URL in the right place. Not making this fix will result in many broken images when we remove the old files from the root (non-blog/) dir.
This would be an easy search-and-replace for a python script, but it's not text files I need to traverse here - it's the movable type database itself, where all the posts are stored. So - any MT experts out there know of a way to do it, with an MT script or some MT plugin?
Thanks!
When I originally set up my Movable Type blog, all the files were in the root directory of my Web server. Now that I've moved everything into a blog/ directory, the blog mostly works fine (clicking around the categories, making new posts, etc.), but there's a problem with the text inside the posts.
Specifically, for all the old posts that embedded an image, the HTML references the image in its old location, in the root directory. I need to go through Movable Type to change all those references to refer to the images in the new place - just adding a "blog/" to the URL in the right place. Not making this fix will result in many broken images when we remove the old files from the root (non-blog/) dir.
This would be an easy search-and-replace for a python script, but it's not text files I need to traverse here - it's the movable type database itself, where all the posts are stored. So - any MT experts out there know of a way to do it, with an MT script or some MT plugin?
Thanks!
You could use a .htaccess file to redirect the old links to their new locations. It's what I did when I upgraded MT and it changed all the permalinks.
posted by mcwetboy at 10:48 AM on June 5, 2012
posted by mcwetboy at 10:48 AM on June 5, 2012
Best answer: Any version since 2005 or so should have a built-in search and replace, as Su mentioned, but you can be doubly sure by also doing redirects through .htaccess.
posted by anildash at 5:30 PM on June 5, 2012
posted by anildash at 5:30 PM on June 5, 2012
« Older Advanced ESL activities for one-on-one tutoring? | Thank you for the gift! Can you recommend an... Newer »
This thread is closed to new comments.
posted by Su at 10:11 AM on June 5, 2012