I don’t know about you guys, but I have a bad habit of misspelling certain words.. no matter how hard I try not too. The main ones for me are doesn’t and Christmas, and that’s a big problem seeing how I operate over 20 Christmas websites!
But there is a solution. And, no, it’s not me paying attention to what I’m typing, I want something easier! How about this awesome little snippet to correct your commonly misspelled words, automatically?
Paste the following code in your functions.php (or your functionality plugin), apply it to as many misspellings as you need, sit back and never worry about misspelling those certain words again.
//Correct my spelling function CorrectIt($content) { $content = str_ireplace("chrsitmas","Christmas", $content); $content = str_ireplace("wordpress","WordPress", $content); $content = str_ireplace("dosen't","doesn't", $content); return $content; } add_filter( 'the_title', 'CorrectIt',1 ); add_filter( 'the_content', 'CorrectIt',1 );
Check it out, here’s our misspelled words in the editor.
Now look at your post, your words are spelled correctly! It’s magic…