I was receiving the following error on one of my WordPress sites for the last 6 months:

Warning: preg_match(): No ending delimiter ‘!’ found in /home/jtpratt/site/wp-includes/classes.php on line 99

I decided to write this quick post because I haven’t been able to find a fix for it for at least 6 months on one of my WordPress blogs, and it just started happenning on another last week. This is what happens:

wordpress error solved

As you can see in the picture above the same 8 lines are added to the top of your blog (homepage only). This has to be the craziest error I’ve ever had to debug because I tried updating WordPress, going to the default theme, disabling all plugins – and not one of those things made the error go away. I even posted in multiple forums and nobody had a clue….until today.

I found this post which pointed me in the right direction, and for that person the “Photopress” plugin was the issue (or so he thought). He fixed the issue with some code, but I think his problem was moving web hosts and permalinks. I moved my smorgasbord.net site last week from goDaddy to Hostgator, and a few days back I noticed the error. Going with the first forum link I gave you – I disabled Photopress (it was already the current version). That didn’t help at all. Then I just “updated” permalinks (just clicked the button, made no changes), and the error instantly went away.

So, figuring I could do the same on my site that has had this problem for at least 6 months – I updated the permalinks there too. Guess what – it didn’t work! Doh! So I disabled Photopress, and STILL it didn’t go away! Then I went into the options of the Photopress plugin and this is what I saw:

photopress plugin options corrupted

I couldn’t believe it, for some reason the photopress options had been corrupted. And then it hit me…I moved THIS site from another host about 6 months ago! The path to photopress and other options had changed. Somehow all the fields changed the weird question mark symbol you see in this pic. So I updated all the options, saved, and then updated permalinks again – and the ERROR WENT AWAY!! Yayyy!

I hopes this gets indexed well in google, for all the people in the future who have this WordPress error – I hope you find this post to answer your question sooner than I did! And to all of you reading this that have had a hard time finding answers to something – please, when you find a fix, BLOG about it so it’s easier to find for the next person!