Fixing Other SEO Firms' Mistakes Using Dreamweaver Wildcard Search and Replace

20 Feb 2008 at 18:31 by Joshua J. Steimle

All too often we take over search engine optimization efforts for a new client, only to find that the last SEO firm or SEO professional they were using did so many things wrong it's going to be a major effort just to clean up their mess, let alone start making progress (although I suppose cleaning up is a form of progress, but you know what I mean).

Case in point, we just took over doing SEO for a billion-dollar enterprise with a substantial website, and what do you know, the last SEO people working on it stuffed the site full of stuffed image alt tags, stuffed keyword meta tags, stuffed url title tags, etc. And they were very thorough with their work in that they didn't repeat the content of the various tags, they mixed it up in every case so they aren't the same and therefore you can't do a simple search and replace to find them all. The slow way to get things done would be to edit every page by hand, deleting the offending code, but thankfully Dreamweaver lets you do a wildcard search and replace that is a lifesaver.

Here's how it works:

First, - [^"]* - Remember that code. You'll learn to love it. Once again, that code is [^"]*.

Now let's say you've got a stuffed image tag like this:

<img src="whatever.gif" alt="keyword 01, keyword 02, keyword 03, keyword 04, keyword 05, keyword 06">

and then you have another one in a separate file that looks like this (notice the numbers on the keywords change):

<img src="whatever.gif" alt="keyword 01, keyword 03, keyword 06, keyword 08, keyword 05, keyword 06">

and you want to replace both of them with this:

<img src="whatever.gif" alt="keyword 01">

And let's say it's not just two tags, but two hundred, and they're all mixed up, except that they all have the common attribute that keyword01 comes first in all cases. Do a search and replace, and search for this:

<img src="whatever.gif" alt="keyword 01[^"]*">

and then replace it with:

<img src="whatever.gif" alt="keyword 01">

IMPORTANT: Check the box that says "use regular expression"

In my case, I'm able to change anywhere from 10-200 alt tags at once, which is dramatically speeding up the process. However, I'm lucky in that when I do a search, there is more than one alt tag that contains the first keyword at the beginning, otherwise when I did the wildcard search it would still only hit one match. If that were the case, I would do a search and replace like this:

<img src="whatever.gif" alt="[^"]*">

to:

<img src="whatever.gif" alt="">

This will empty out all the alt tags on the entire website. Granted, then I have to worry about filling them in again, but I was going to have to do that anyway, so I might as well speed up the process of deleting the junk that's in them.

You could do the same thing to delete all the meta keyword tags on a site at once, even if the keywords in each tag on each page are different.

Now I agree there should be a better way to do this using some specialize SEO tool, but if it's out there I don't know about it. If you do, let me in on the secret.

digg digg it!  delicious, mmm Add to del.icio.us

Comments

You could also do this using shell/terminal and a perl regular expression like this:

perl -pi -e 's/find/replace/g' *.txt

where FIND is the text you want to find and REPLACE is the text you want to replace with. this will fidn and replace in all files that end in txt, so you could change this to do html or whatever. you can use perl's regular expressions much in teh same way ouy use dreamweaver

Posted by: web design blog at April 7, 2008 12:38 AM

A beautiful method I must say! The most beautiful part about this little code snippet is that you can use it to replace just about anything - including those most irritable snippets of code placed in invisible layers and the margins of a page that some unnamed SEO 'professionals' are still using to boost their clients rankings. Obviously it's not exactly a catch-all, but definitely a keeper for those of us thoroughly entrenched in th Macromedia Dreamweaver way of instituting clean html. Thanks a bunch!

Posted by: Jon Suarez at May 5, 2008 08:37 PM

Post a comment




(you may use HTML tags for style)

Recent SEO Articles

Why Google Shouldn't Discriminate Against Paid Links

21 Apr 2008 at 14:58 by Joshua J. Steimle

Because it can't accurately identify them. Frankly, I don't have much against Google having something against paid links. It's their search engine, they can do whatever they want with it. Of course I'd prefer they live and let live when it comes to paid links, for my own self-interest as someone who occasionally uses paid links as a way to build incoming links for my SEO clients.

But the problem is there's no way for Google--I should say "no effective way"--to differentiate between a paid link and one that isn't paid for.

The SEO Con Artists

17 Apr 2008 at 09:31 by Joshua J. Steimle

A real description of an SEO firm on an SEO directory:

Full service 1-on-1 SEO marketing since 1996. Check out comprised month-to-month packages at SEOgame.com (Eg. $375 package will start out at 2,220 manual directories and 550 manual article directory submissions) Manual submission services will provide permanent 1-way links and include 3 project managers and 17 site submitters to get the job done right with lots of worrrrrrrrrrrrrrrrrk! Get to the top of the in less than a month for your top keywords today.

If you're shopping for SEO services and you hear this type of pitch, you might figure "Hey, it's only $375 and maybe I'll get something out of it even though it sounds too good to be true." But what you should be thinking is "For $375 I could take my wife out for a really, really nice night on the town, and the ROI would be higher to boot."

Fixing Other SEO Firms' Mistakes Using Dreamweaver Wildcard Search and Replace

20 Feb 2008 at 18:31 by Joshua J. Steimle

All too often we take over search engine optimization efforts for a new client, only to find that the last SEO firm or SEO professional they were using did so many things wrong it's going to be a major effort just to clean up their mess, let alone start making progress (although I suppose cleaning up is a form of progress, but you know what I mean).

Case in point, we just took over doing SEO for a billion-dollar enterprise with a substantial website, and what do you know, the last SEO people working on it stuffed the site full of stuffed image alt tags, stuffed keyword meta tags, stuffed url title tags, etc. And they were very thorough with their work in that they didn't repeat the content of the various tags, they mixed it up in every case so they aren't the same and therefore you can't do a simple search and replace to find them all. The slow way to get things done would be to edit every page by hand, deleting the offending code, but thankfully Dreamweaver lets you do a wildcard search and replace that is a lifesaver.

Organic SEO Articles >>