Ever feel like you want to use white-out on your blog for content you need to remove or replace? If you move from Blogger to WordPress, your posts are sure to contain text that you no longer want. For example I had a post template that added this to the end of new posts:
Notice the spider logo has a bad image address (it’s no longer hosted where I had my html website ). I wanted to stop using the spider anyway. Also the signature logo has the wrong background color for this template and I no longer use it on recent posts.
My current post ‘footer’ is a simple call to sign-up by email. So I scratched my head until a resourceful teammate found this plugin for one of our clients. The client’s blog had a funny rss-atom link that was used in the Blogger feed but appeared at the bottom of every imported post. Apparently Blogger screens out the line when displaying the posts.
To the rescue: The Search and Replace Plugin
A simple search for find strings in your database and replace the string. You can search in ID, post-content, GUID, title, excerpt, meta-data, comments, comment-author, comment-e-mail, comment-url, tags/categories and categories-description.
- Add and Activate the Search and Replace plugin. Find the plugin options under Tools on the dashboard. You’ll notice and need to respect this warning:
- For images, get the current html that you want to replace and do just a search for the string before any replacements. Find a post and view the html mode for exact string! In my case the html for the signature was:
<a href=”http://l.b5z.net/i/u/6049594/i/blog/relatedspider.gif”><img style=”float: left; height: 50px; margin: 0px 10px 10px 0px; width: 60px;”src=”http://l.b5z.net/i/u/6049594/i/blog/relatedspider.gif” border=”0″ alt=”spider logo” /></a>
- Place your string in search-only box, check the ‘field’ box press Go button The Search found 6 posts with that image string. (Write down the names of the posts just in case!)
- So let’s replace it for real. Rather than substitute a different image, I want to replace the spider logo with a line break: <br/> Be sure to first select where to search/replace — I checked off ‘content’. Paste the string, this time in the real search spot. Place the new string (in my case a line break) code in the” replace” field. Close your eyes and press “Go.”
- Here’s what one post looked like after replacement of spider logo only:
- I then did the same for the signature html, replacing it with a blank line.
Tips and Strange Happenings
The results seem to include revision copies of the posts you want to change. And in one case I was editing one of the posts while the plugin was running so it created an autosave which I had to publish to see the removed text! So don’t have any posts in edit mode at the time. Also the search only results had various post ids different from the published posts.
I discovered the actual html in terms of upper/lowercase varied so that my search missed some posts where the html had “Float:” instead of “float:” or placed the ‘height=’ in a different spot within the tag. So I had to find the variations and redo. It helped to search for ‘spider logo’ then see the posts listed and spot the variations. Perhaps depends on whether post was published in Blogger or WP and how WP felt that day — who doesn’t want a little variety? … lol
You might ask was this worth it for 6 or 9 posts? Well, yes since the posts may be sprinkled in your archives and who wants to go hunting for them? If nothing else the search-only will give you a results list to go in and manually replace.
Bottom line, it works. Just be sure to backup your database. Happy erasing!
Let me know what you use it for — leave a comment.