My biggest pet peeve on running this blog

I have to fix this several times a week…please read and heed. I’m hoping that if I announce this as a post, it will reduce the problem.

No can’t fix this issue with comments, I’ve asked.

PLEASE be careful when trying to bold, italicize, link, or blockquote in comments. Just one transposed character is all it takes. Also, there’s no need to try to hyperlink URL’s, WordPress will automatically hyperlink any URL you type in like this:

OK, please note this, then burn it into your mind, slash BEFORE, not after. Thanks for your consideration – Anthony

0 0 votes
Article Rating
Newest Most Voted
Inline Feedbacks
View all comments
Bryn Thomas
March 19, 2011 4:21 pm

Just checking

March 19, 2011 4:24 pm

I understand.
You might consider if there is some code that can be automatically inserted at the end of every post that will turn off any such markup that the post has left on.
REPLY: And that is what I asked for…no can do -A

March 19, 2011 4:31 pm

Why not expand the HTML tags and attributes to show exactly how to make use of them. Use simple examples.

March 19, 2011 4:39 pm

>>i>I’ve never had that problem. Myself, I’m not that familiar with html.
[Reply: I can tell. You did the backward “hosed” tag that Anthony wrote about, and every post after yours was in italics. Fixed now. ~dbs, mod.]

March 19, 2011 4:40 pm

I was going to suggest a scratch-pad permanent thread, but then found that you have one on the menu bar, labelled “Test” – good to see (if maybe a bit obscurely titled), and I think it may be useful to note the link/thread/purpose in the heading of the post. If you can set it to auto-purge at 10 or 15 posts, it would make for a good scratch-pad/preview area for those wanting to test out their tags/posts. It won’t eliminate typos, but we don’t live in a perfect world. Good luck! 🙂

March 19, 2011 4:43 pm

I am an old fashion kinda a guy–*stuf* or _empfassis_ is good enough for me. If you can’t do it with a 4-row teletype, it doesn’t need to be did.
What if everybody _started_ their comments with **?

March 19, 2011 4:48 pm

A lot of people don’t know this, but the REAL culprit behind broken html codes? Yup. Global warming.

March 19, 2011 4:51 pm

@Larry Sheldon: We would be baudoted to death?

March 19, 2011 4:53 pm

Someone left the tag open. I’m putting in a closing tag here:
I think that should work for everything after this…

Sadly, no, and that’s the maddening part about it. – A

March 19, 2011 4:54 pm

Many thanks for the illustration on the error of my HTML ways
on screwing up the “slash” in front of the “i” when trying to italicize.
I’m still adjusting to my new trifocals.
Don’t I recall you saying some time ago that isn’t
able to provide a segregated sandbox for HTML test runs on our
comments before we enter them onto the thread ?
My old Word editor won’t let me run HTML tests at home.
[Reply: use the “Test” page in the masthead menu. ~dbs]

March 19, 2011 4:55 pm

Hmm. Guess not. a few more?

Mike Jowsey
March 19, 2011 4:56 pm


March 19, 2011 4:57 pm

I sympathize completely, Anthony.

North of 43 and south of 44
March 19, 2011 5:01 pm

Yup global warming.

March 19, 2011 5:04 pm
Leon Brozyna
March 19, 2011 5:04 pm

Not only every following comment, but also all the text in the sidebar.
[You da man!☺ ~dbs]

North of 43 and south of 44
March 19, 2011 5:06 pm

Now about what the fine WordPress peeps told you.
It is baloney.
The generated code from a posting operation is under complete control of the WordPress system they can block any attribute from being open at a post boundary.
True it will slow things down but it is doable.

March 19, 2011 5:07 pm

The only problem with publicising something like this is that there are people out there who will now do this sort of thing just to cause mischief.

Jeff Alberts
March 19, 2011 5:25 pm

This is really a bug with WordPress. They should automatically self-contain each comment and run a filter to weed out errant html for allowed tags. I realize this is nothing AW can fix, it’s something WP needs to fix.

CRS, Dr.P.H.
March 19, 2011 5:33 pm

…I feel like a kid that just got spanked by Dad! Forgive us our sins, Anthony!

Rattus Norvegicus
March 19, 2011 5:37 pm

WordPress could fix this iff they ran stuff through HTMLtidy before sending it to the database. I used it to fix some tragically screwed up HTML entered idiots who were incorrectly trained in how to enter HTML in our database and who insisted, even after I corrected the training advice, in entering tragically bad HTML. Tell the geeks at WordPress that HTMLtidy can fix lots of egregious problems in user entered HTML. There is no excuse.

March 19, 2011 5:38 pm

If it’s such a common error, it really shouldn’t be so hard for WP to run a regular expression hunt/fix for the incorrect tag, replacing it with the correct tag.
I’ve moved to using BBCode rather than HTML tags for user interaction in my own website development projects, specifically to circumvent this kind of issue. It’s the best way by far to prevent code injection etc.

March 19, 2011 5:41 pm

My experience is that even knowing how to properly use HTML tags and being a veteran at it does not prevent a simple mistake in the heat of commenting.
When drafting a comment I find that using a full capability word processing program with spell checking at least brings attention to the HTML tags as being a misspelled word. So you can at least look to see if it is correctly constructed. When everything is OK in the word processor then cut and paste to the WUWT comment box.

Doug Deal
March 19, 2011 5:42 pm

I am a web application developer by trade, although a Chemical Engineer by education.
Anyway, if you want to test any html code with tools that you very likely already have, you can simply put it into a text document, save it and open it with the browser. In I.E. it is control-O or under the file menu. Instead of entering a URL, click browse and find your file.
Alternatively, on a PC, you can right click and “open with” your browser.

may help
March 19, 2011 5:44 pm

How about adding “</i>” and “</b>” to the end of every post by adding it to the template code? Looking at the code, a posting on this page is always enclosed in <div class=”comment-body”> and </div>. Adding </i></b> before the </div> in the template will stop the error from mangling all other posts and unnecessary closing tags are ignored by the browser.

March 19, 2011 5:46 pm

Earlier ( at ) I tried to suggest a set of closers at the start of every comment–they of course disappeared, but a later demonstration showed it wouldn’t work anyway.
In that same comment I suggest that we don’t really need the HTML: for ShrNfr, think of the energy we’d save–ASCII is a 7-bit code in an 8-bit envelope, baudot is a 5-bit code in a (depending on how you count it) 5-, 6-, or 7-bit envelope.

Bob Diaz
March 19, 2011 5:49 pm

I will be more careful about that.
Test Bold Normal
Bob Diaz

R. Craigen
March 19, 2011 5:49 pm

Cool. I gotta try the backwards tag. (just kidding!)
Why not include the capability for users to edit their own comments — like many blog sites do? This would not completely eliminate the problem as many people wouldn’t realise their comments were problematic, but it would probably dramatically reduce the number of interventions needed by admins.
Also, Anthony, you’re taking on too much yourself. This blog has so much traffic you really should have sufficiently many volunteer admins that you rarely have to touch the site at that level. I’m for having that sort of task delegated to a couple of your most trusted helpers who have a flair for it.

March 19, 2011 5:53 pm

Probably should just fix the software. There’s no excuse for the software being so bad that a formatting error in a comment breaks a page.

March 19, 2011 5:57 pm

Anthony, since this bugs you, is there a way to just turn off all tags?
They aren’t really necessary.
.. and like John said, it’s like misspelling a word, even experts can mess up..
I don’t use them, ever, I know I would mess one up and know it would bug you. But if I did, I would do like John says and copy into word first…………
REPLY: I wish there was. Copying into Word only makes the problem worse as word is a terrible HTML editor that adds lots of extra junk -A

March 19, 2011 5:59 pm

If you have a site admin, or have a trusted person who has at least dabbled in php, here’s what you need to do:
tell them to find the region in the commenting script that parses the database record row by row. There should be a specific line that handles the body of the comment. From there, all you have to do is something like the following:

if(stripos($database_row['comment'], '' && !stripos($database_row['comment'], '')){
$database_row['comment'] .= '';

where “$database_row[‘comment’]” represents the content of a database result’s comment field. This scriptlet will determine whether or not a comment has the tag without its closing tag.
You can email me at dcdorset ~@~ gmail DOT com if you need more help. I really enjoy your site, keep up the good work!

March 19, 2011 6:02 pm

Argh, it still stripped out my italics tags. Email me if you think i can help.

King of Cool
March 19, 2011 6:03 pm

May I also suggest that you make your guide a little more explicit under where you enter your post as every-one may not know what all your HTML tags mean and how to use them:
Something like:
for the tags you allow.
Or by adding a ‘Complete Idiots’ type guide to the RHS side of the page where you have other references.

March 19, 2011 6:06 pm

Surely this is a problem with the theme?
If you placed a permanent closing tag for italic and bold after the end of each post (after the closing LI tag) the problem would disappear….
Yes, it would be slightly poor HTML, but so what?

March 19, 2011 6:16 pm

A Tech resolution will beat out an appeal to ignorance resolution every time. You will be frustrated forever until you outsmart the problem.

March 19, 2011 6:21 pm

There are several WP plug ins that provide WYSIWYG editing or preview capabilities.
With the current setup, commentors must post blindly; they can’t verify that they’ve done the tagging correctly.

Ben U.
March 19, 2011 6:21 pm

High up in the sidebar I’d put:
Close tags correctly. Right: </b> Wrong: <b/> Right: </i> Wrong: <i/>
I wish I were acquainted with WordPress. I have trouble believing that you couldn’t manually put extra closing tags into the template. I just checked and found places where it would work in Google Blogger templates, both the “classic” template and the recent one. Seems simple. (Of course, Blogger interrupts the posting of a comment with an unclosed (or badly closed) tag anyway, so I can’t test the effectiveness of adding of extra closing tags into the template.) (I’m not saying you should switch to Blogger, I know that WordPress has advantages.)

March 19, 2011 6:26 pm

As to bold and italics, yes yes. Another squirrel in WordPress’ HTMLow tree is its treatment of links: the URL must be between double-quotes. In normal HTML, the quotation is optional unless the URL contains special characters.
The following example may become garbled; I’m assuming that WordPress treates the “code” tag correctly.
This works:
WattsUp won the prize.
resulting in:
WattsUp won the prize.
This doesn’t:
WattsUp won the prize.
resulting in:
WattsUp won the prize.
Every blog software package I’ve come across has strange bugs in its HTML parser; Wp is not alone in this.

Pompous Git
March 19, 2011 6:27 pm

North of 43 and south of 44 said @ March 19, 2011 at 5:01 pm
“Yup global warming.”
Nope. HTML’s screwed @43degrees south and we ain’t got no global warming! If you have any spare you can send down here, it would be very much appreciated 😉

March 19, 2011 6:28 pm

Nope, Wp doesn’t handle the “code” tag correctly… A “Preview” option would be helpful..

March 19, 2011 6:28 pm

I use Firefox with the Climate Audit CA Assistant script enabled.
Seems to work ok on this blog
(Except for embedding images which fails)
Firefox enabled CA Assistant also has a Preview button

David Falkner
March 19, 2011 6:42 pm

Would it still happen if you went back to nested comments?

Darren Parker
March 19, 2011 6:48 pm

Why not just let the trolls know how to bring down your blog while you’re at it!
[Reply: it’s easy enough to fix, and if someone does it more than a couple of times, they might end up in the spam bucket permanently. ~dbs, mod.]

March 19, 2011 6:49 pm

When we talk about HTML, I strongly recommend, which contains tutorials, references and examples of basic HTML

Nullius in Verba
March 19, 2011 6:56 pm

The problem is due to lazy coding on the part of WP, and a somewhat complicated muddle of syntax between different markup languages.
WP do in fact filter comments for unbalanced tags and other problems. That’s why attempts to fix it by other posters putting in closing tags don’t work. The filters spot these as unbalanced tags and delete them.
I think the bug is in a function called force_balance_tags. First they find a tag. If it starts with a / they assume it’s a close tag. If it doesn’t, it’s an open tag, but if an open tag ends with a /, they immediately (and incorrectly) assume that it is an XHTML self-closing tag and ignore it. They don’t check to make sure it is one of the valid self-closing tags. This means that the i/ combination gets treated as a self-closing tag and is left in. The original i-tag is closed off, but the second i/-tag is not.
Since the browser thinks it’s reading HTML, and self-closing tags are not valid in that language, the closing / gets ignored and it acts just like a normal i-tag and turns everything to italics.
I am sure it is fixable, but could be tricky to do without breaking something else, and high-level computer geeks of the sort who dream in regular expressions put a low priority on proofing things against idiots who can’t even manage to code basic html properly. They’re like that.
As I’m not such an expert, I could be completely wrong – but that’s what it looks like to me.

March 19, 2011 6:59 pm

we know your reasons for sticking with as you have explained them several times, and they make sense, especially on a short time horizon. However, it is also pretty much obvious WUWT is here to stay, and hence must consider three-five-more years perspective. WordPress, either in its hosted or standalone incarnation, won’t take you much further. Among the audience of WUWT, there are hundreds of people with experience of coding for other platforms who would be only happy to contribute.
At risk of starting ‘WordPress vs others’ flame war, this is still something to consider.

March 19, 2011 7:01 pm

It would require a sea change, but the folks over at Stack Overflow ( and friends have been using Markdown ( rather than HTML for text formatting with great success. It started out as a programming site, but has grown a bunch of companion sites covering a wide array of technical (and even non-technical) topics, and the learning curve for the typical user seems pretty short and easy. I would wonder if WP could do that too. Markdown uses plain ascii text in ways that are familiar to typewriter (and teletype) users.

March 19, 2011 7:06 pm

Being irremediably absent minded, I am one of the guilty. But I found a simple solution:
Type the close tag first!

Tom T
March 19, 2011 7:16 pm

That’s why I don’t mess around with those things. I know its just asking for trouble.

March 19, 2011 7:21 pm

From Rodney Carrington

March 19, 2011 7:21 pm

What we need is a preview function.
Lots of sites have them.

March 19, 2011 7:25 pm

I thought it was that you won’t allow any discussion on your blog about chemtrails?

March 19, 2011 7:46 pm

My biggest pet peeve – all the people here who don’t understand that their suggestions are things that can’t be done without assistance from WordPress.
Second biggest peeve – that WordPress doesn’t fix the bugs.
Rule to live by – You get what you pay for! All in all, WordPress does a pretty decent job with this free offering.

March 19, 2011 7:52 pm

juanslayton says:
March 19, 2011 at 7:06 pm

Being irremediably absent minded, I am one of the guilty. But I found a simple solution:
Type the close tag first!

While that’s a very good idea, it’s not the problem. If you write a <i> and forget to terminate it, WordPress will terminate it for you at the end of the comment. The problem is when people mistype it – WP apparently thinks it’s an end command, but browsers don’t.
I tried adding my own </i> at the beginning of a comment to see if that would terminate a runaway italics block, but it didn’t work. I guess WP is trying to count the depth of the italics and once out of sync stays out of sync.

March 19, 2011 7:56 pm

The way I do it is to read the HTML comment in to an XML document, and then write out the XML. This closes unclosed tags automatically.
This could be integrated into a WordPress plugin, but I don’t know how much control WordPress gives you over custom plugins.

March 19, 2011 8:06 pm

ATTN!!!! Mods and Anthony, Here;
is the link to the global ranking of the suggested key words to add to the header section of your pages, so your blog will show up in the search engine results.

Stan Needham
March 19, 2011 8:09 pm

I’m a moderator on another blog, and WordPress solves this problem in the edit mode, where each comment has an HTML tool bar directly above the comment. I’ve always wondered why they couldn’t do an abbreviated version of that tool bar in the comment mode with the codes you show below the comments here. Then all the commenters would have to do is highlight the portion to be altered and click on “bold” or “italics” or “delete” or “link”, etc., much like you do in Microsoft Word.

March 19, 2011 8:14 pm

There seems to still be a difference between ranks generated by Google as compared to the other two search engines though.

Rattus Norvegicus
March 19, 2011 8:16 pm

You are completely wrong. HTML does have valid self closing tags, button, input, hr, br are a few of them. The problem is that HTML is an ugly language which is ill defined. There are far too many tags in HTML which do not require a closing tag. You can’t really deal with this in regular expressions and need a full parser. This is why I recommend HTMLtidy which is a full parser and detects silly mistakes and corrects them. XHTML requires closing tags (whether self closing with a / before the closing > or a / [tag] > for the closing tag. In XHTML every tag requires a closing tag. In HTML this is not the case. HTMLtidy fixes this as best it can and does a pretty good job. Once the input, as filtered by HTMLtidy is clean you can then pass it to the validator (however you implement it) and get far better results in filtering for dangerous tags.
In the system which I write and maintain that means running the input through HTMLtidy and then through an MS security library to get a safe HTML fragment for storing in the DB. There are other libraries which do the same sanitizing of HTML input for PHP. I assume that WP does sanitizing, but it is clear that they do not do correction (provided by HTMLtidy). Hey, it works for me!

March 19, 2011 8:19 pm

Under these circumstances, any reasonable person would turn off HTML tags.
Thanks for not doing that!

March 19, 2011 8:26 pm

So install an RTE.
So simple. Use an RTE or fix coding mistakes. As you can see from the previous comments, most people don’t know how to code. And why should they have to?

March 19, 2011 8:28 pm

Personally, I avoid adding tags manually.
Anthony, have you considered the “Quicktags” plug-in? If people had a button to do it on the comment box, that’d cut down greatly on manual editing errors.

Steve in SC
March 19, 2011 8:44 pm

OK boys and girls.
Here is a short tutorial for all you folks with really fat fingers.

March 19, 2011 8:58 pm

Here’s a simple comment html composition, and preview, method that works on almost any blogging service, or forum.
Windows Live Writer is free. And it’s very compatable with WordPress, as well as a lot of other blogging services. If you compose a comment, or post with Live Writer, it’ll format the html for you. You get a WYSIWYG environment to compose a comment in. And when you’re done, simply toggle from the ‘Edit’ view, to the ‘Source’ view, to see it displayed as html. You can then copy, and paste, your comment from Live Writer’s ‘Source’ view for perfect html every time.

March 19, 2011 8:59 pm

REPLY: And that is what I asked for…no can do -A
Wow, really? They said no to that? That’s terrifically bad customer service.

March 19, 2011 9:51 pm

And they said computers would make our lives sooooo much easier…

March 19, 2011 9:59 pm

Maybe overly simplistic but why not just switch your commenting engine to IntenseDebate or Disqus instead of the WP default? They even import the old WP comments?

March 19, 2011 10:01 pm

Like the moderator said earlier Word is very bad for HTML. Use a plain text app like Notepad. We use Dreamweaver at work, but most people can’t afford the latest Adobe Suite.

March 19, 2011 11:06 pm

Amazing to me that WordPress is unable to resolve this very simple problem. A real simple piece of code could fix this issue easily. I use this technique in many applications that I have written. This is one of those things that makes me go “hmmmm”….

March 19, 2011 11:07 pm

Hint to WordPress: Learn a little bit about regular expression parsing…. 😉

March 19, 2011 11:32 pm

Rattus Norvegicus says:

Tell the geeks at WordPress that HTMLtidy can fix lots of egregious problems in user entered HTML. There is no excuse.

Wordpress is free, open source software, isn’t it? Then, noone can really blame the geeks at WordPress since users are enabled to fix it themselves.

March 20, 2011 12:51 am

But, Squidly -as others have pointed out- HTML does not follow regular expression rules consistently. There are a countable number of self-closing tags, which would make the project non-trivial.
The very simplest solution would be disable all HTML tags in comments. Even then one could enter a link as text.
The next simplest solution would be a preview function, but I can’t say if that’s part of the base WordPress set, or requires some sort of plug-in. The milblog (highly recommended) runs WordPress and features a preview function for comments. Perhaps you could contact Lex and ask him about that?

March 20, 2011 1:29 am

A solution like TinyMCE is not a good idea. Bad security, heavy on bandwidth and performance. My preference for public facing user input forms is BBCode. There’s a great BBCode parser in PHP called NBBC.
I made a very little, 10 tag javascript RTE plugin for this library and you can convert BBCode to HTML either going into the database(higher performance) or coming out(more extensible). Surely there is something out there like this for WordPress.
Also, a comment preview would help catch alot of this stuff.

March 20, 2011 2:12 am

Well, it’s not just that I am a bit lazy – but when I want to write a comment I really cannot be bothered to alter font and style, etc. It detracts from my line of thought, and I am always concerned I’ll get it wrong! Hence, no change for me!

March 20, 2011 3:37 am

Strike one?

March 20, 2011 3:38 am

As a web developer, I find WordPress’ assertion that they can’t do anything mildly ridiculous. They could implement any number of solutions to stop this happening, at no discernible expense to loading times or processing power. Poor.

March 20, 2011 3:38 am

I think that I get it… maybe not

March 20, 2011 3:42 am

Add a preview to the commenting as so many other forums have and an option to edit your post if you made an error. Set time to edit 20-30 min.
No matter how well aquinted you are with typing or html, your fingers don’t always find the right keys. Mistakes do happen and here (in this forum) you have no option to correct it. Only mods have that option, and you have chosen that yourself.
I use html everyday, and I still make typing errors.
Notepad++ was the text editor of choice for me using Windows. Now it’s Smultron.
(same, same but different) I always “code” my html using that.

Nullius in Verba
March 20, 2011 5:27 am

“You are completely wrong. HTML does have valid self closing tags, button, input, hr, br are a few of them.”
HTML doesn’t have self-closing tags, what it has is empty elements that don’t have end tags. They don’t need closing because nothing has been opened. If you tried to close them yourself, it would be invalid HTML.
HTML has elements, some self-contained in a single tag, some with content surrounded by opening and closing tags. XHTML is supposed to be valid XML which tries to handle all tags generically according to the same syntax. All tags come in pairs; an opening tag and a closing tag. The idea of a self-closing tag only makes sense in XHTML where all tags have to be opened/closed.
One thing I did find interesting about this was the fact that because WP publish their code, it’s possible for other people to figure out exactly where and why it goes wrong. The other part of the process – them acknowledging the problem and fixing it – is still missing. But open code does have it’s plus points.

March 20, 2011 5:36 am

The moderators that remain at the overheated blog now try to inject closing tags to prevent the spent comment from overbolding…
[very good! ~jove, mod]

March 20, 2011 6:34 am

Skip says:March 19, 2011 at 9:59 pm
Maybe overly simplistic but why not just switch your commenting engine to IntenseDebate or Disqus instead of the WP default?

Please no! Anthony, do NOT switch to Disqus. It’s one huge pain in the butt and terrible for reading – especially when trying to catch up (you have to read the entire thread again so as to catch nested responses!)

March 20, 2011 6:34 am

Putting the closing slash first is actually incorrect – it’s one of those “improvements” brought to us by our friends at MS and became the standard at WP because WP is windows heritage software.
As far as I know there’s no good solution to this. The usual council of despair, changing to a better publishing package, won’t fix the problem because so many people use windows apps to write and pre-format their text and/or comments – and those apps will insert incorrect mark-up into their output.
One option to consider, if you run on a unix server (e.g. Linux) is to create a script that runs through the comments tables cleaning them up; then have cron automate running that once every couple of hours. There are minor idiosyncracies to this, but you probably know someone who can not just do this, but -and much more importantly- babysit the thing for you afterward.

March 20, 2011 6:47 am

My PHP foo is less than it could be, but it looks like the str_replace function if placed in a new function in your functions.php file would do it for you.
Something along these lines:
add_filter( ‘the_content’, ‘close_tags’, 25 );
function close_tags( $content ) {
return str_replace( ‘i/’, ‘/i’, $content );
Any PHP wizards here that could help? I’m sure the above is not 100% correct (namely the content variable I expect needs to be the post variable).

March 20, 2011 7:12 am

This is one of the reasons I don’t link, unless automatically. Another is that I would prefer to make the argument myself and suggest that others look for confirmation or refutation. Yet a third is that links deteriorate and then there goes your argument.

March 20, 2011 7:19 am

Richard Holle @ 8:06 PM
Your comment suggests an experiment. Test the rankings at each search engine before and after adding those key words. There must be some reason this fairly simple experiment is inadequate, else it would have been done already.
Go, go grantwriters.

March 20, 2011 7:48 am

JoNova,has a very nice comment box set up.
It was set up by a computer expert Steve LeMaster,who was the Founder of Global Warmig Skeptics blog/forum,that I now own.
I get the impression that the real problem is that does not allow a fully developed comment box as seen at JoNova.Jo does not use WordPress server.Thus is able to have the nice row of html tags to use that are preset.
Go see what I mean in this link:
Scroll to the bottom of the page and see it.

Nullius in Verba
March 20, 2011 8:33 am

“Any PHP wizards here that could help?”
I don’t claim to be one, but I thought it might go a bit like the plugin text below. (It’s a million to one shot, but it might just work.) However, I make no claims for the safety or correctness of this. I’ve got no way to test it.
Plugin Name: Filter malformed tags
Plugin URI:
Description: Replace mistyped i/, b/ and a/ tags in comments
Version: 1.0
Author: Nullius in Verba
Author URI:
License: Lesser GPL
function filter_malformed_tags($content) {
$bad_tags = array(‘<i/>’,'<b/>’,'<a/>’);
$good_tags = array(‘</i>’,'</b>’,'</a>’);
return $content;
Hopefully that won’t mess up the page too badly. Apologies to moderators in advance if it does.

March 20, 2011 9:42 am

Looks like you nailed it Nullius in Verba 🙂

Ed Fix
March 20, 2011 9:58 am

The last time I tried to use the “Test” page (and again just now), there was no “Leave a Reply” section at the bottom of the comments. How do we test comments there?
REPLY: You must not be living right, it is there now 😉
What happens is that auto closes comments after 30 days, I have to keep reopening – A

Rattus Norvegicus
March 20, 2011 10:05 am

Looks like crossed wires in our communication. I was using “tag” as a synonym for “element” and this led to the incorrect conclusion. It does appear you are correct.
The ending / followed by the tag name is the standard for HTML closing tags and has been since at least 1997 in HTML 3.2 (this is the earliest spec I could find at

March 20, 2011 10:08 am

The WordPress dashboard has a checkbox “Settings – Writing – WordPress should correct invalidly nested XHTML automatically” that closes unclosed tags in comments, and the setting is available to users who cannot use custom plugins. users can use a custom plugin to do it more neatly in some special cases, but even then the built-in setting is a useful fallback for those cases that the plugin misses.

March 20, 2011 10:25 am

I used to experiment. I’m sure I’m guilty. I won’t try HTML things from now on – and learn by doing. I’ll try to really understand first, not guess. No more, “let’s see if this works”
My apologies, Moderators

On behalf of
March 20, 2011 10:37 am

Sincere apologies, Anthony. As someone who frequently notices speeling spelling mistakes on newspaper websites – Telegraph take note – I can understand the annoyance.

March 20, 2011 10:47 am

Sorry A, it isn’t my fault. I think the people of Belgium changed the formula for Anheuser-Busch products. I never had this problem in the nineties!

Nullius in Verba
March 20, 2011 11:13 am

“Looks like you nailed it Nullius in Verba :)”
Hardly. The plugin shows how trivial it would be to do, but there’s a big difference between, the free host-your-own blogging software, and, the hosting service. Plugins are only allowed on the former, at your own risk. Anthony can’t change any of the code or add plugins, preview tools, or edit controls because won’t allow it. Their buggy software messes up comment handling, and there’s no way he can fix it.
The only solution is for commenters to not mess up their tags.
I’m sure WordPress know perfectly well how to fix it, but apparently they’re not going to. do say that if you want particular features then you can write and request them, and the most popular may be implemented one day if they happen to feel like it, but I wouldn’t hold your breath.

March 20, 2011 11:35 am

For a long time, posters on Free Republic had a great time doing fancy stuff with HTML in their posts. Sometimes, someone would forget to close a tag, and everything following would be affected.
It got to the point where some folks had an automatic string in their posts which consisted of five or ten of the closing tags for each of the more common HTML tags people were using.
This doesn’t seem to be a major theme on Free Republic these days, but I didn’t catch anything happening to address it.
Anyway, to everyone who may be confused, common HTML tags are listed below the comment window. To close a tag, you slash it. = “slash italics”. If you have the slash anywhere else, you’re not slashing the right target.

March 20, 2011 11:36 am

Oh, all right. </i> = “slash italics”. <i/> is slashing something else.

Steve P
March 20, 2011 11:45 am

Here we are with powerful computers and flimsy software. Unless the HTML is really botched, it shouldn’t that difficult to write subroutines to find and fix open tags, or even sense what we’re trying to do, and auto-complete for us. For italics, long sequences in italic should be disallowed by the software. Alas…

March 20, 2011 11:56 am

sunsettommy says:
March 20, 2011 at 7:48 am
JoNova,has a very nice comment box set up.
It was set up by a computer expert Steve LeMaster,who was the Founder of Global Warming Skeptics blog/forum,that I now own.
I get the impression that the real problem is that does not allow a fully developed comment box as seen at JoNova.Jo does not use WordPress server.Thus is able to have the nice row of html tags to use that are preset.
Go see what I mean in this link:
Scroll to the bottom of the page and see it.

At the bottom of the JoNova page it says, “Powered by WordPress.”
Maybe she uses a paid version and not the free one that Anthony uses. The Comment box with the select-and-click formatting and a Preview function would be a big improvement here.
/Mr Lynn

March 20, 2011 12:36 pm

When I leave a comment with a link as far as I’m aware I do it correctly, but if I’m not please let me know so I can mend my ways. Thanks

Eric Ellison
March 20, 2011 3:28 pm

WTF! Is this post a Joke?
This is an ‘article’ on the BEST!!!! Climate technology site worthy of comment? Interesting that We the Commenters can ‘break’ the website with a synatax typing error! I would think that some computer program with field validation or range checking rules would have solved this problem. In Teletype days it was called a rubout.
I understand the plea from the moderator. Is this site the best that the Internet technology offers? Hardley! It’s archaic! How many $ will it take to get a state of the art Internet Anthony Watts Website?
Time to move up the ladder! What will it take to move this blog into real time Internet technology?
Yes! I still have a Model 15 Teletype. It works and I can ‘smell’ it, but I have moved on to other technology!
I got a Social Security check for $1000 I’ll donate to a really good Anthony Watts website! Anyone else?

March 20, 2011 4:06 pm

Must say I was delighted with this Post.
As a late and relatively senile entrant to the computer/internet world in general, I’ve often wondered about all the gimmickry which everyone else seems to understand: I have never dared to try to use it, so cannot be guilty – yet!
And now AW has given me an insight: don’t worry, I’ll try it out on a ‘commercial’ site first.
The trick I most admire at present is saying what you think, then sticking a thin line erasure through it so it can still be read.
Now, about my very dusty Function keys . . . .?

Ed Dahlgren
March 20, 2011 6:09 pm

Yeah, preview would be good.
I could live without HTML in my comments, but I surely do like to suppress long, ugly link addresses. And I like blockquotes, the occasional italics, and bold from time to time. So I test it on a Blogger site I have before pasting it here.
That may bite me one day as I’m sure that WP and Blogger aren’t congruent in how they handle HTML, *and* Blogger’s preview isn’t as WYSIWYG as it claims to be.

Dave Springer
March 20, 2011 7:29 pm

The need for embedded hyperlinks is that it makes things a lot more readable.
There is a WordPress plugin to help your users with this and more which I’ve installed on WordPress blogs in the past but unfortunately your particular WordPress host doesn’t allow you to install this or anything like it that I could find.

Dave Springer
March 20, 2011 7:36 pm

Eric Ellison says:
March 20, 2011 at 3:28 pm
“Time to move up the ladder! What will it take to move this blog into real time Internet technology?”
Actually WordPress is hosted on a cloud server which is generally considered to be cutting edge stuff. In reality the cutting edginess is economic in nature rather than nifty new usability features. One restriction is that customizing WordPress with plugins on a blog by blog basis is prohibitively difficult. Another restriction is that the blog owner has no access to IP addresses of commenters which is sometimes a very valuable anti-troll tool.

Dave Springer
March 20, 2011 8:05 pm

I’m still amazed at the great troll control here. It must be a lot of work. I had an X-Panel so I could use IP blocks on the server and also modify the WordPress php source code to reduce the workload in various ways but moderation was still time consuming on a controversial blog with many thousands of unique visitors every month and unlike here I had registration turned on too! A couple of trolls discovered the trick of using a dial-up modem (dynamic IP) to defeat IP blocks. If you block the IP address of such a troll all they have to do is hang-up the dial-up connection and re-dial (takes about 30 seconds) and they get a different IP address on reconnection. The counter-move for that was for me to block the entire range of IP addresses of the phone-bank they were using. There was a very remote chance I’d block legitimate users of that phone-bank but so few people use old fashioned dial-up modems anymore I thought it worth the risk. Another problem I had was administrative access control. I didn’t care for the access selections given to different user-levels as it allowed editors to monkey around with the blacklist and there was no audit trail so I couldn’t find out who among a number of editors was doing things I didn’t want done so I got into the WordPress source code and restricted access to the blacklist to top level administrators.
Having access to IP addresses in general is very handy and you lose that in a cloud. For instance if you have someone claiming to be a professor at UCLA but all his comments are originating from a phone bank in Possum Trot, Kentucky it’s pretty unlikely the claim is true. On the other hand I busted more than one liberal professor pretending to be someone else by googling his IP address and finding it associated with his real university email address in some server log or another that google’s web crawler stumbled across and indexed. It was quite fun playing Dick Tracy on the internet. Amazing what’s out there if you know what to look for and how to look for it.

Dave Springer
March 20, 2011 8:13 pm

mikemUK says:
March 20, 2011 at 4:06 pm
“The trick I most admire at present is saying what you think, then sticking a thin line erasure through it so it can still be read.”
Yeah, that’s a very gay clever embellishment to be sure!

Brian H
March 20, 2011 11:22 pm

An easy approach to getting open&close tags in place fur shur is to type both before entering the contents. E.g. <i></i> after typing the content becomes <i>content</i> on the entry page and content on the display page.

Brian H
March 21, 2011 12:01 am

Ed Dahlgren; has a feature called “Custom alias”, so one can put a descriptive title instead of the alphanumeric index. E.g.:

March 21, 2011 12:26 am

These limitations by wordpress really surprise me. It is sooooo easy to solve. I am almost a newby in web page programming and it took me just 20 minutes investigation and about 10 lines of code to learn and implement how to disable any html tags introduced in user comments in my web page (1 single line of php code), and then enable the bbcodes [b][/b], [i][/i] for bold and italics (two lines of code each) with automatic closing of any of those which could be still open by the end of the comment (a few extra lines). Sooooooooo simple. Other html tags with parameters such as the one for hyperlinks are just marginally more complicated.

Al Gored
March 21, 2011 1:32 am

Just testing the Italian, or something like that. A bold new adventure.

March 21, 2011 4:50 am

It’s the Sun dammit , hee, hee. keeps getting it wrong in so many ways. It’s turning into a slow train wreck.

March 21, 2011 4:57 am

It’s the Sun dammit, hee, hee. keeps getting it wrong in so many ways. It’s turning into a slow train wreck. Recheck.

March 21, 2011 4:58 am

OK, underline not working.

March 21, 2011 6:56 am

You can test it by opening a text file in notepad or equivilent basic text editor. Save the file as “filename.html” and then open it up in a browser.
A proper html file should have a the correct doctype declaration, a head and body etc. but for the purpose of testing simple text formatting, you don’t need to do this.

March 21, 2011 7:22 am


March 21, 2011 7:26 am

OK, I guess I don’t know how to do the clever html stuff here, should be simple though, underline, strikethrough, etc.

George E. Smith
March 21, 2011 2:13 pm

Well I’m from the old school; the do-it-yourself KISS school.
So my limit of fanciness goes thus:_ “”””” cut and paste what you said “””””
So that’s five spaces, then five double quotes, then five spaces, then what I cut and pasted from whoever’s name is at the beginning, and then five spaces, and five more quotes, and five more end spaces just for good measure. And sometimes I will expunge some of what I cut and pasted, so you don’t have to read through five pages you already read, to get to the punch line. Forgive me if I sometimes forget to put in some …… to indicate my deletions.
Yes you won’t find this in any English Grammar book and Dr Richard Lederer; father of Poker Player extra-ordinaire Howard Lederer, and his equally dangerous sister Annie Duke; Donald Trump girlfriend (Joan B. Rivers) trumper supreme; and the world’s greatest authority on the English Language; would never condone it, in any of his 535 books on English; but I use it anyway; so you know it’s really me.

March 21, 2011 5:56 pm

Two Words: Rich Text Editor
Haven’t I seen WP blogs that use a javascript-based edit box (usually called a “rich text editor”) like the ones provided in most forum input windows? That keeps things rolling along nicely for many a website.
(It’s a Joe Biden joke)

March 21, 2011 10:18 pm

thepoodlebites says:
March 21, 2011 at 7:26 am

OK, I guess I don’t know how to do the clever html stuff here, should be simple though, underline, strikethrough, etc.

Check the bottom part of my guide to WUWT, linked to above or go now to . I tried to organize things by most useful/popular first.

March 22, 2011 4:13 am

It’s the Sun dammit, hee, hee. keeps getting it wrong in so many ways. It’s turning into a slow train wreck. It really is the Sun and PDO, not CO2 induced CAGW. It’s natural climate variability.

Brian H
March 23, 2011 12:17 am

People trying to do underlines and stuff should just read the light grey text below the Comment box. That’s all she wrote. <del> and <strike> produce the same effects.
The CAAssistant script using GreaseMonkey puts others at the top of the Comment box, but not all work. Underline is one of the non-functional ones, I think it does a paragraph break. Etc.

Brian H
March 23, 2011 12:19 am

Nope, it does nothing. Superscript O2 and subscript CO2 are there, too.

Brian H
March 23, 2011 12:20 am

But they don’t work either!
So it’s just the ones listed below the box.

March 23, 2011 8:14 pm

I just ended up on this site through a link and wanted to inform you that your layout looks a a bit broken, the sidebar looks a little distorted. At least in Netscape, so the problem might be related to my browser.
Just wanted to let you know about it so you could look into it if you want to…

Larry Fields
March 24, 2011 1:29 am

Thanks. I wasn’t sure how to do that kind of formatting here. It’s comforting to know that it’s similar to the formatting with which I’m familiar, except that the squarish brackets are replaced with the pointy brackets.

Brian H
March 24, 2011 2:23 am

Netscape? Netscape?
I got news. It’s not the site which is broken. Your browser comes from the wrong century. Even AOL has given up on it. Load and run Firefox, the most recent incarnation of the Netscape legacy.
I’m surprised you can read any sites at all!

March 24, 2011 7:34 pm

To hope means to be ready at every moment for that which is not yet born, and yet not become desperate if there is no birth in our lifetime.

Dave Springer
March 25, 2011 6:22 am

K~Bob says:
March 21, 2011 at 5:56 pm

Two Words: Rich Text Editor
Haven’t I seen WP blogs that use a javascript-based edit box (usually called a “rich text editor”) like the ones provided in most forum input windows? That keeps things rolling along nicely for many a website.
(It’s a Joe Biden joke)

Words are always hard to count especially using numbers.
(Yogi Berra might have said something like that)

Dave Springer
March 25, 2011 7:37 am

I can hardly believe WordPress hasn’t fixed an unclosed italic (or bold or whatever) in one comment spilling over into all the subsequent comments. That was a problem I was dealing with 2 years ago. It couldn’t be that difficult to fix. A really easy way would be to append all the allowed html tags to the end of each comment. There appear to be 14 allowed which would be 109 extra characters per comment which isn’t much in the way of extra overhead. It’s been a while since I did any kludging of wordpress php sources but I reckon’ the above is a single line of code added in a comment processing module. Of course you can’t do that unless you have read/write permission to the wordpress root directory on the server and WUWT is on a cloud server that doesn’t allow it.

%d bloggers like this:
Verified by MonsterInsights