Focus Keyword Error on Yoast WordPress SEO Plugin

Focus Keyword ErrorRecently, I’ve  installed WordPress SEO Plugin by Yoast on my blog, learn all the features and play with its setting for a while just after the fresh install. The plugin works well and plays nice with my rtPanel theme. Good work for Joost de Valk, -a well-known SEO guy- for the great SEO plugin.

The SEO metabox is the feature that I really like of, it allows me to completely optimize my post tittle and meta description on a per post basis. The plugin also gives me an easy way to control, choose and change focus keyword on my post and gives me a nice snippet preview of my post would look like on Google search.

I love the way page analyst works on giving and suggesting me some considerations point to be remind dealing with my page optimization. And there is nothing to worry about the consideration point suggested by the page analyst since I’ve full control for being to consider or ignore it.

Dealing with Focus Keyword Error

After re-working with some of my post, actually there’s no any problem and difficulty I found, till I got an error on one of my posts, the error occurred whenever I save the post, after inputting the focus keyword. Here’s the error message I’ve got :

"error Warning: preg_match_all() [function.preg-match-all]: Unknown modifier 'I' in /home/sulistyo/public_html/wp-content/plugins/wordpress-seo/admin/linkdex/linkdex.php on line 476"

Facing the error I’ve got above, first I  checked the directory and line defined by the error message, I assume there’s something dealing with letter “I” on the directory and line mentioned by the plugin, but  I’ve no clue at all then, since I found there’s no letter “I” on the directory and line mentioned, here is what I’ve got on the directory mentioned :

 WP SEO's Fokus Keyword svn

$keywordCount = preg_match_all("/".$job["keyword"]."/msiU", $body, $res);

Re-saving my focus keyword over the page that gives me the error  didn’t solve the issue, except resulting different error message, the error message says :

"error Warning: preg_match_all() [function.preg-match-all]: Unknown modifier 'p' in /home/sulistyo/public_html/wp-content/plugins/wordpress-seo/admin/linkdex/linkdex.php on line 476"

Dealing with having no clue  on solving the “focus keyword error” and hoping for the conclusive answer, I decide to bring my question to WordPress plugin support forum. Unfortunately, I get no answer, and I found that there were the same question has been asked by someone, with the same result, no answer for the such ” focus keyword error ” question.

Bringing my question about ” focus keyword error ” to WordPress Stackexchange was the really right step that gave me the conclusive answer and solution.  There was Gennady Kovshenin, a good guy whose helped me out dealing with my ” focus keyword error “.

By his (Gennady Kovshenin) help I conclusively know what was the causes of the error and how to solve it. Actually there’s nothing to worry about  dealing with  ” focus keyword error “, since the error was only a minor bug of the plugin dealing with the unsupported expression/character I have inputted on my focus keyword. In my case I have a slash [ / ] on it, and I hope the issue should be taken care soon by developer (Joost de Valk). – hope it will be as soon as possible -.

As an alternative solution while waiting for the plugin’s update, the focus keyword error on WordPress SEO Plugin by Yoast can simply  solved by rewriting :

$keywordCount = preg_match_all("/".$job["keyword"]."/msiU", $body, $res);


$keywordCount  = preg_match_all("/".preg_quote($job["keyword"])."/msiU", $body, $res);

About how the replacement code above works can be explained : the preg_quote matches your special regex character/expression you have on your focus keyword, so it won’t fail. And in fact it works as it should be.


My Big thank you to Gennady Kovshenin and Joost de Valk

Updated: The issue has been fixed since the release of version 1.1.7

About Sulistyo

a WordPress enthusiast, Jazz and Delta Blues addict, an Indonesian who tend to learn achieving a native-like level of English writing.

2 thoughts on “Focus Keyword Error on Yoast WordPress SEO Plugin

    1. Thanks Joost, thanks for your great plugin, and pointing me the patch. Although it’s a rarely that a keyword has a slash, it will be good if the plugin supports and allows slash expression on it. Thanks for stopping by and I can’t explain how happy I am for it.., You guy’s rock….

Comments are closed.