Software: Search and Replace Wordpress Plugin (1.1)
This is a plugin for Wordpress to allow you to search and replace text across all your posts.
This plugin is for Wordpress 1.5 or better (including 2.0).
It is uses SQL replace so it’s fast but not very flexible.
Just download the zip, extract the searchandreplace.php file and place it in your wp-content/plugins and then in the wp-admin plugin interface active it.
You will then have a new panel in your “Manage” section called “Search and Replace”.
German langauge version available. Supplied by Frank
Persian language version avaliable. Supplied by Gonahkar
History
Version 1.1: 4th January 2006
Search and replace for comments and comment authors from Gonahkar added. Tested on Wordpress 2.0.
Version 1: 23rd March 2005
First version




Does this plugin work? The readme does not express confidence or assurance of success. Rather than back-up and have to reload the SQL database, I’d be interested to know what the likelihood of failure will be.
Goal: replace “/www/images/” in a reference globally with “/www/images/postimage” so that I can rearrange my server…
Hi Señor Epiphyte, I haven’t tested it extensivly but it worked fine for me in all my tests.
The warning in the readme is a ‘just in case’.
Worked for me. Thanks!
Installed the plugin but its not appearing in the ‘Manage’ section, is there is a filename I can just manually type in? I dont necessarily need a visual thing I can click on.
I’m using the most recent version of WP, 1.5.1.2
Hi mESH,
And you have activated the plugin from the “Plugin | Plugins” screen? I don’t know what could be the problem. I’m using WP, 1.5.1 on this site and my testsite and it seems to appear.
You could try the link directly but I doubt it would work if it’s not appearing in the menu:
http://your.wordpress.address/wp-admin/edit.php?page=searchandreplace.php
mESH, try logging in as an admin user. I setup the permissions so only admin users can use the plugin.
Hmm, doesn’t show up on the manage page in admin and I’m running WP 1.5.1.2. I have a user rating of 9.
Oh wait, nevermind. I edited the user rating down to 9. Now it works. Thanks.
Thanks… work nice for me
I wisk in futur version, there are the search & replace with special sql string: ‘*’ ‘?’
example:
- search “En*” will give result: “Enter”, “Entry”, “End”…
- search “thedead???” will give: “thedeadone”, “thedeadtwo”…
If ‘*’ and ‘???’ are supported by SQL then they should work now, I guess, as the plugin just uses whatever text the user puts in the fields to search against. I’ll have to try it and get back to you on it.
Worked great…thanks for this. I had an old b2 blog that I exported. Somehow (during export, or as a function of b2) every apostrophe had a slash in front of it ( \’ instead of ‘ ). Running an update command with to fix apostrophes made me a little nervous because I thought the apostrophe would break the SQL string(s), but it worked flawlessly.
How does the your test result? Does the ‘*’ and ‘?’ work now?
Thank you. Your plugin has saved me hours of work!
hello,
i tried to DL the zip, but the file’s extension is “.pl” and i’m not sure what program that is for? thank you!
Hi Jon, are you sure about the “.pl”? Did you download the searchandreplace.zip and extract the contents (because they should all be .php as they are wordpress plugins)? I just tried to download it there and it worked fine for me…
though are you refering to “ax.pl”? This is just a redirect perl script (see http://thedeadone.net/software/wordpress-and-axs-integration-plugin/ for more) and shouldn’t be downloaded. BTW, .pl is for perl scripts.
??
hi i’d like to thank for this plugin its great! but i have a few questions. how can i replace all the posts in my database in batch i mean i have a table of words to search and table to replace the search i want to just click replace it replaces all the posts in the database. can it be done?
ahh and sorry for my english thanks
I’d like to tryout the plugin, but the download gives me a 404… Could you give me a location where I could get the goods? =]
never mind that last comment, the download works… (I followed some direct link to the file, which 404′d, using the link from your post worked)
hi, i edit your plugin to search n replace in the comment text and comment author, it can be new version, how i can send it for you?
Thanks for your plugin! Great! Just found out that the link leading to this plugin on http://wp-plugins.net/ is dead. You might want to correct this.. Cheers!
Thank you!!! Thank you!!! Thank you!!! Thank you!!! Thank you!!! Thank you!!! Thank you!!! Thank you!!! Thank you!!! Thank you!!! Thank you!!!
Your plugin works perfectly and just saved me from manually editing thousands of posts.
I’ve integrated Gonahkar’s changes and tested the plugin on Wordpress 2.0.
I’ve also investigated adding wildcard support. Currently MySQL does not support wildcard or regex for REPLACE so I wont’ be supporting it in the near-future.
Enjoy.
Hy Mark,
i have translate your Plugin for all german WP-users. I hope you enjoy.
With best regards, Frank
Link:
http://www.bueltge.de/wp-suchen-und-ersetzen-de-plugin/114/
Wow, cool. Thanks Frank.
Just letting you know the download URL on the website:
http://wp-plugins.net
is broken.
Thanks Tom. I thought I had corrected the link but obviousily I hadn’t. Now it is fixed.
Good job! I can never remember the exact command for search & replace using phpmyadmin. This plugin saves me time. Of course I’d backup the database first before using it. I’d do that even if I were to use phpmyadmin anyway… just in case.
Keep up the good work!
How can I replace line breaks with non-line breaks. I’m having a small problem from when I imported my Blogger posts. Check out my blog and you will know what I mean.
hello
i try using this plugin to replace a text, to bold text .. like baby , replace baby
but then all my image eror, because their link contain that text … hmm .. how to trick this?
Does the new version work with 1.5.2 or should I stick with the old one?
Hi Ajay D’Souza, it should still work in 1.5.2 AFAIK. It was working in 1.5 and it still works in 2.0.
Great, am going to give this a shot
This plugin seems great, but I would like to replace the ‘carriage return’ & ‘new line’ characters that Wordpress converts into the ‘p’ tag.
After importing from blogger a bunch of posts, I got a lot of those ‘p’ in the wrong places. I might be able to replace at least one of them which comes always before a certain tag and really shouldn’t be there, but search and replace doesn’t seem to work with the ‘\n’ and ‘\r’ special characters. The ‘p’ tag doesn’t seem to be there at all, since it is added by wordpress only later, in the rendering of the page.
So how can I get search and replace to work on those ‘new paragraph’ chars?
Any workaround?
Thanks!
Wait, I solved the thing about the ‘p’ tag I addressed in my previous comment.
I read others had just the same problem. Too many ‘p’ tags in the posts instead of simple line-breaks. This has also the downside that p tags are autmatically closed by wordpress, creating weird formatting in certain situations.
Trying to solve it with ’search and replace’ plugin it’s the wrong approach!!
you can solve the problem this way:
just install the ‘text-control’ plugin for wordpress, then go into options and set your text formatting engine to ‘nl2br’, and ’smart pants’.
All the ‘p’ tags will be gone.
The problem is in the rendering wordpress does, not in some characters contained in the posts!
Hope this helps. It worked for me, big time.
Frank - you are the wp god of my admiration. What a wonderful thing you have done. I’d moved batches of stuff over manually from a previous blogging app and had hideous amounts of stray stuff show up after. Manually replacing it was an odious chore, but you saved me so many hours, and it was all of it done in 15 minutes, download to complete.
Thank you so very much.
Frank? Hey I wrote the plugin, Frank translated it to German, Lex!
Plugin saved my life… well, saved me from editing over 1,000 posts manually.
Cheers,
-Aaron
sorry i need this plugin
tested it but not working in arabic
why?
any suggestion plz ?
thanks
this is very useful plugin
thanks
One other enhancement might be to add the field “Category”…so that one could replace category names in all posts.
Worked like a charm — Thanks!
http://www.striderweb.com/blog/229
Hi, this plugin works great!!!!!!
kisses!
I’m so sad I can’t get this plugin to work for me! Recently I changed hosts, and when I did all my ellipses (…) were replaced with “?��Ǩ��” and all my em-dashes (—) were replaced with “?��Ǩ��?”–I had high hopes that this plugin would correct them for me, but though it says “searching…replaced!” all the weird characters are left in there…anyone know what all this is about? I sure don’t want to download my db, do the s&r in there, only to upload it again and discover that it’s happened all over again…ideas?
Hi unnarrator, I’m not sure I can. I would have loved to be able to update the plugin to report what it changed, but it’s a rather dumb plugin and all it does is an SQL replace which doesn’t support that kind of functionality.
As for the weird characters, where do they come up? Is it on a webpage or when you edit the entry? Is there a difference between the two copies?
Thanks for responding, Mark—when I downloaded my SQL db from one host, search-and-replaced all the URLs and so forth, and uploaded to the new host, all the diacriticals were inexplicably changed (and I use a lot of French in my posts…).
I could go into every entry and edit them, which works, and I’ve done about 50 of them; I just don’t want to do this for all the pages on the site, cos I’m lazy. :o)
Hope this makes sense. Example page at:
http://theunreliablenarrator.net/2006/07/15/tiny-times-goofed/
Maybe a better answer to your question is: the weird marks are there both inside the WP editor *and* on the pages themselves.
Worked perfectly for my purposes…. Thanks a lot!
Hi unnarrator,
That sounds very strange. Could you do an export of your database (using the database plugin) and have a look at a post there? If possible, could you send me (or post a sample of) a snippet of a post from the database?
Sounds like you may have to do it manually. The plugin just does an SQL update command.
This plugin is simply great! Saved me many hours doing the search and replace. Thanks.
Hi Mark and thanks for your help–here’s a sample of the wackiness–it sounds like Anatomy of a Blog Move used the S&R plugin to fix a similar problem, so I’m terribly envious!–
“Merci ?ɬ� Lucinda, I hum while I pick dried rosemary needles from the keyboard?��Ǩ���Eloise’s afternoon effort at reducing the one to the many. And then type vigorously, seething, energized with angry?��Ǩ���and why? Because…” et cetera.
(Where the ???s were em-dashes.) I guess this can also be chalked up to “Unicode rogueness” but alas I’m having to go into each entry and change by hand. Such is life! Thanks for trying to troubleshoot anyway….
Does anyone know the name of the wordpress plugin that creates a list of your posts in a category instead of just displaying them one after the other? I want it so that when someone clicks on a category they just get a list of posts from that category.
I'm sure Ive seen one…and sifting through the WP site is a nightmare
Thanks Mark, saved me hours of work transferring images from our old blogspot site to our new wordpress server. Great work. Exactly what I was looking for.
Hi Pierce, this isn’t really the place to ask for that kind of stuff. I’d recommend wordpress.org/support.
However, what your really looking for is a theme. You do not need a plugin to show the list of posts in a category, just a theme that lists the posts for the category template rather than display an extract. In fact, it’s just a matter of removing some code from most existing themes.
Worked on the first try. Thank you very much.
Sure, Will search and upgrade the wordpress as per you idea… Thanks dear…
Fan of Don Lapre
larisa@larisajoyreilly.com
Hi Mark,
I am using this plugin on http://bond.write2kill.com/. Of course, nothing to show on site.
Anyway, thanks for creating this plugin. Your credit is here: http://bond.write2kill.com/?page_id=1511
Cheers.
w2k
You have made the impossible possible with this plugin, and saved me a whole day of work at least! Thank you
*bows down in eternal gratitude*
you rule with giant fists of steel! thank you so much for allowing me to fix in seconds what would have taken an eternity by hand.
What a time saver. Thx for the great plugin.
Gosh… you just made my day! You just allowed me to edit a couple of thousand posts within two seconds. Thanks so much!
Frank
thanks a bunch for this little plugin, appears on my “must-have” list
best,
michael
Wow, wonderfull… i find this plugin, and i get it here, thanks
Thanks for free plugin. This plugin important for me
Great plugin,… would be fine if it would replace words from the “tags”-table into links. Would be the best,…. any idea?
Olaf
Beatifful one the writting Thank you..
many thanks for this plugin — it works like a charm. Great stuff!
Hello, My name is Ben and am the project manager of WP-Support.de and wanted to request herewith with you whether we may offer your WordPress Plugin with ourselves in the forum to the download, of course under your copyright and a link to your side. The forum deals all around WordPress and we add there the Support. Yesterday we have done a new start of the presence, because there was in the old forum Blogging-Portal.de some problems. We want to reach amit that even more people can use your Plugin. I would be glad very much, wennw ir your approval would agree. Please, send to me with an answer your URL. Many thanks and Yours sincerely Benjamin Pötschke
You ROCK! This was exactly what I needed and is saving me HOURS of work. Thank you thank you!!!
THANK YOU SO MUCH !!! I had like 200 posts to modify ! You save me a lot of time !!!
This is exactly what I was looking for !!!
To use it I did a small change, I put a textarea instead of that simple input text , like this and it worked !
Thank you again !
Very nice plugin - already in use at my blog. Thank you!
Hi there,
Thanks for this very handy little tool, i will install it on my site http://my-ad-sense.com.
I use a auto feed poster and sometimes it post the feed with some funny caracter in front like my
Hope it works, and will let you know
Michael
It’s very beautifully.
I downloaded, installed, activated with no problems. But its not taking out the crazy � from my friends blog?
I first left the area ‘to replace’ empty
then thought that maybe it needed to ’see’ something so I put in a dash to have it replaced by……
still nothing. what am I missing here? smiles
i use this plugin on my site and it’s very helpful. however users should proceed with caution and double check everything before hitting that “replace” button. One wrong character or check box could lead to nasty results.:D
thanks a lot for your plugin
god! i was looging for this plugin for a long time! thank you for your work!
Wonderful plugin, thank you so very much!
Hi! Great Plugin!
I need to delete from all my posts all the stuff wroten as [tags][/tags] and the inside between that code. I’ve tried with [tags]*[/tags] and [tags]*.*[/tags], but it didn’t work. I don’t really know what I do, because I have to delete that and replace it with an empty field.
Any ideas?
Thx
hi nitroglicerino, I’m afraid this plugin can’t do wildcard searchs. I believe someone has done an updated version of it that does support it.
i have a Worpress 1.7 and this plugin very help me thank’s
I long time looking for this inforamtions and suddenly I find here. Great job
I have questions: is this plugin work on wordpress 2.2.3 because i don’t know if I can instaled this.
hey i’m using WP v2.3.1 and this plugin works great!! thanks for making this possible!
This plugin is a lifesaver. Thanks so much!
Is there a way to search for and replace (p) (p) of course using the correct brackets? Ive tried replacing the the html code with the space as normal, & nbsp ; and & #32 ; ??
will this plug-in search and replace links or code pages?
thanks
Hi,
Is there a way to automate the search/replace? EG: Once a day/hour/whenever the posts are searched for ‘hello world’ and are replaced with ‘Hello World’?
That would make my life even easier….you just made it all the more easier with this manual execution of search & replace :O) Thank you! x 100!
Mike
thanks for this great and very easy to use plugin!!
Thank you very much, this plugin is very helpful!
Mark,
This is an awesome tool. I used it to mass-convert the width of embedded videos (i.e. width=”400″). Much appreciated!!
Your plugin worked perfectly for replacing links in my podcast, however, it did not change any enclosures. Still have to go through an manually change all of them but at least half the work was done in a matter of seconds!
Thanks for your great plugin. I enjoyed with your creation
wow, wonderfull…thank, i like your plugin
We had to upgrade mysql and now I have crazy characters in several hundred posts. You have saved me hours and hours of work; thank you!
One question though, if I search for ab does it replace every a and b ? Or only “ab” together?
I just realized how dumb that question was. I blame nyquil. Great work
Thanks for your great plugin, it very usefull
Great plugin.This plugin saves my time to edit my posts.thanks.
does this replace anything in “Pages” also ? or just posts ?
because i cant change the words in my “Pages” section.
thanks
rudy
Hi, thank you, great plugin, keep spirit
10x for your nice plugin
Thank you
Keep up the good work! 10q
Just what I needed. Saved me a TON of work. Thanks!