Categories
General

Replacing strings in old WP posts

After trying several different methods of including photos in posts I had images scattered in several folders and links pointing all over the place. I could have just left the old stuff in place, but that offended some silly aesthetic sense. So, I wanted all of the image references and links in the old posts replaced with the new stuff.

Unfortunately, WordPress doesn’t have a built-in tool to find and replace strings in old posts, probably a good thing due to the potential for disastrous user error. There are some plugins that filter the text in posts, for instance to censor posts or to expand shorthand, but nothing to change old posts directly. Finally, I found this thread at webxpertz.net with a discussion of how to do exactly what I wanted to do. Feeding this SQL snippet to PHPMyAdmin worked perfectly:

UPDATE wp_posts SET post_content= REPLACE (post_content,'old string','new string') WHERE post_content LIKE '%old string%' ;

Categories
General

Welcome to isaacwedin.com

It’s mostly a place for Photopress, my WordPress plugin, to live instead of at my personal web site. You’ll also find ideas about running a family weblog here eventually.

Categories
General

Hawk in the backyard

I startled this hawk from the deck railing and it flew up into one of the trees in the backyard. Looks like maybe it’s a Sharp-shinned or Cooper’s Hawk.

Hawk in the backyard

Categories
General

WordPress Comment Spam Fun

I started getting comment spam at wedin.org over Thanksgiving, and since then every WordPress site I’m involved with has gotten at least some. It’s relatively easy to delete the spam, but that’s clearly not a real solution. Turning off comments would obviously fix it, but a blog isn’t very fun without comments. I’ve listed below a few sites with information and tools that I’ve found helpful.

This site has a nice overview of the problem, and many (all?) of the various available methods of fighting it.

Spam Karma seems to be highly recommended, and it uses tons of different methods of detecting spam. However, I’ve found it tends to eat real comments, which sucks. It’s highly adjustable though, so it may just be a matter of checking the right boxes.

This post at the WordPress support forum suggests renaming a couple of comment-related files to confuse the spam bots.

This WordPress plugin is very simple, and shouldn’t affect real users at all. Seems like spammers will find a workaround pretty easily though.

So far, there’s no method that’s perfect. Spam Karma works very well, but deletes real comments occasionally. The last two methods seem to work, but are so simple that I’m afraid spammers will be able to program a way around them too easily.

Categories
General

Ironic Recycling

The Nov/Dec 2004 ReadyMade Magazine (the coolest paper-and-ink magazine around) has a link to Very Cool Things, which sells The Emile Berliner Gramophone Turntable, which apparently lets you record your very own LPs onto worthless CDs.