Somewhere along the way, it seems that WordPress started requiring a space or line break after a smiley key in order for the key to be properly replaced with the smiley image.
For example:
, said the hyena.instead of:
:lol:, said the hyena.The first has a space after the ": l o l :" key, where the second does not.
I probably could have dug through the WP code and found where to change this, but the new behavior doesn't really bother me and I only had a couple of places where I needed to fix this.
Here is sample SQL1 to see if you have places in your database that need fixing:
SELECT *
FROM wp_posts
WHERE post_content LIKE '%:,%'SELECT *
FROM wp_posts
WHERE post_content LIKE '%:,%'etc.
And here is the SQL to fix it:
UPDATE wp_posts
SET post_content =
REPLACE(post_content, ':,', ': ,');UPDATE wp_posts
SET post_content =
REPLACE(post_content, ':.', ': .');etc.
Of course, you want to make sure you back up your database first before making sweeping changes like this. I screwed up the syntax myself and had to restore my posts table from my nightly backup.
It happens.
- This all assumes the standard 'wp_' prefix for your database tables. [back]
Popularity: 6% [?]

Rirath adds this Comment:
Interesting, that does indeed explain a thing or two.
January 23rd, 2007 at 9:03 pm
Les adds this Comment:
I had some fun with that while testing 2.1. I used the Search and replace plugin rather than working directly with MySQL. I also modified WP-Grins to make sure to pad spaces around new smilies - documented here.
January 24th, 2007 at 1:50 am
Emu adds this Comment:
To “fix” Smilies in Wordpress 2.1 just line:
$wp_smiliessearch[] = '/(\s|^)'.preg_quote($smiley, '/').'(\s|$)/';in /wp-includes/vars.php with
$wp_smiliessearch[] = '/(\s|^)'.preg_quote($smiley, '/').'/';Regards Emu
January 24th, 2007 at 7:41 am
Alex adds this Comment:
Simple, yes - but when you end up with a dozen or so of those little tweaks to be done on each upgrade, it’s a hassle. Making my data comply with WordPress’ expectations is a better forward-looking solution.
January 24th, 2007 at 10:02 am
Emu adds this Comment:
You are right, Alex.
I know this disadvantage well but I post that solution for people that do not want to edit his post and database records.
I’ll try to write a plugin that make this changes on the fly, so if the Wordpress developers do not change the regular expression in next versions, this “fix” to work. If I success with develop, I’ll post here again.
Regards Emu
P.S. Sorry for my not so good english.
January 24th, 2007 at 5:41 pm
David adds this Comment:
Where the behavior is most annoying is in comments. Average folk are more likely to use colon-parenthesis symbols which WordPress won’t replace correctly “on the fly” unless someone happens to luck into the secret method. I don’t get so many smiley-laced comments that’s it’s actually a problem for me, but it did happen often enough to drive me to the codex and help forums to see if it was just me…
January 24th, 2007 at 6:56 pm
Emu adds this Comment:
How I promise, I write here again ;).
I wrote a plugin that “fix” wordpress 2.1 smilies. If someone want it - Usmivki.
Regards Emu
January 26th, 2007 at 12:50 am
Mark adds this Comment:
But what about smilies that have not a space in front of them? They are still being parsed as text instead of smilies….
February 6th, 2007 at 10:57 am
Mark adds this Comment:
e.g. say that :cheese: is a smilie.
:cheese::cheese::cheese::cheese:
will only give
[smilie]:cheese::cheese::cheese:
February 6th, 2007 at 11:11 am
加入表情符號(2.1版以後) adds this Pingback:
[…] smiles Cleanup|alexking […]
August 7th, 2007 at 10:27 am
wp-grins插入表情(2.1以後) adds this Pingback:
[…] smiles Cleanup|alexking […]
January 26th, 2008 at 10:00 am