Module/Method to cleanup content of Drupal site? I have been assigned with the task of maintaining a specific Drupal site. The problem is that the person who created the website did not actually think it through. No input filters to be heard of, no restriction for images' placement, plain HTML everywhere.

I'm now on the spot, since I've promised to tidy up the website, and I've just realized how much work will it require. There are articles that are copy+pasted from wikipedia (the WYSIWYG editor kept all the formatting), random websites or (even worse) from MS Word. 

I understand that I will have to do some manual editing and check the articles one by one, but I was wondering if there is some kind of a method that someone may have used in a similar situation. Perhaps a module that will cleanup the html of the various nodes? 

Note: The website is built in Drupal 6, but if you have suggestions for Drupal 7, I guess that I could upgrade.
Normally, when I have encountered this, there is too much variety to do much automated cleanup.  You can do something like this, though

$sql = "
  SELECT n.nid
  FROM {node} n
";

$result = db_query($sql);

while ($row = db_fetch_object($result)) {
  $node = node_load($row-&gt;nid, NULL, TRUE); // bypass internal cache
  $node-&gt;body = _filter_htmlcorrector($node-&gt;body);
  node_save($node);
}


Either stick this in a custom menu entry or make a simple script for it.  Depending on how many nodes you have, you may need to use the Batch API.

_filter_htmlcorrector will fix bad HTML to an extent, and I have also used check_markup with luck, too.  For check_markup, you just need to figure out the numeric filter number to use.

Other than that, you really do need to play with the processing you do in the loop.  This will give yourself a head start, but you still need to edit each article and manually check/fix things.