pig-monkey.com
Here are recorded many goings and comings, doings and beings; stories, symbols and meanings. Gossamer threads that may be woven into a larger web: a story of this Age of the World.

Removing Target Attributes from Wordpress Links

Dec. 8, 2007

For years, I’ve always added the target attribute to links going off-site. And for a while less, I’ve wished that I hadn’t — I believe that where a link opens should be left up to the user — but never had the motivation to stop or, more importantly, go back and edit all the old links.

Till now.

Instead of the Transitional doctype, I want to validate my pages with XHTML 1.0 Strict, in which the target attribute is deprecated. Google had the answer, in the form of Lorelle’s guide on search and replacing in WP databases. It’s quite simple, even for one with database-fu as weak as mine. Just login to your database via phpMyAdmin, hit the SQL button on the upper left and enter your query.

Lorelle’s sample is:

UPDATE wp_posts SET post_content = REPLACE (
post_content,
'Item to replace here',
'Replacement text here');

I had to change my table, which is still named from my b2/cafelog days, and so executed this:

UPDATE b2posts SET post_content = REPLACE (
post_content,
'target="_blank"',
'');

Shiny!

Comments

blog comments powered by Disqus

Recent Photos

  1. Field Message Pad Covers: Rear
  2. Field Message Pad Covers: Front
  3. Rhodia Installed
  4. Rhodia Installed: Open
  5. Rite in the Rain Installed
  6. Rite in the Rain Installed: Open
  7. Field Message Pad Covers: Inside
  8. Field Message Pads
  9. Field Message Pads: Open
More photos...

Recent Tweets

  1. Remember when the Linksys WRT54G was going to change the world? http://t.co/XmIZUuLu The good old days… posted 8 hours, 55 minutes ago
  2. @bfgreen I bought a hank of that Glowire after your review. Pretty nice stuff! posted 1 week, 5 days ago
  3. Currently reading: Eastern Approaches by Fitzroy Maclean http://t.co/OkPhTLJz posted 2 weeks, 1 day ago
  4. I need one of these bio security packages for my bike: http://t.co/Tts7EbuC posted 2 weeks, 3 days ago
More status updates...