WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I hope someone could realy help me...

I get this error message :

"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" 

when I enter/write a focus keyword on wordpress seo meta box.

I don't know what to do to solve the error. I hope someone or the developer of the plugin (Joost de Valk) could help me with this error - thanks.

I really need your help...

share|improve this question

closed as off-topic by Pieter Goosen, Mark Kaplun, birgire, Otto, gmazzap Nov 22 '14 at 21:19

This question appears to be off-topic. The users who voted to close gave this specific reason:

If this question can be reworded to fit the rules in the help center, please edit the question.

I browsed through all the versions available here http://plugins.trac.wordpress.org/browser/wordpress-seo/tags/ and nowhere is there any "I" modifier. The "I" modifier is obviously invalid, thus the error. Updating the plugin will most certainly solve the issue. Or at least, if updates are not possible, edit line 476 of /wp-content/plugins/wordpress-seo/admin/linkdex/linkdex.php and turn

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

or whatever it may have to:

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

An update:

After you mentioned 'P' being an invalid modifier, it suddenly struck me that the keyword is not escaped and that you may be using a backslash / inside of there, breaking the regular expression.

While you're waiting for an update you can rewrite the line to:


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

Note how I changed the / to # delimiters, you're probably not going to use those, so your expression will not fail.


Alternatively you can use preg_quote like so:

$keywordCount = preg_match_all("/".preg_quote($job["keyword"], '/')."/msIU", $body, $res);
share|improve this answer
Joost de Valk has been notified, issue should be taken care of soon. Good luck. – soulseekah Apr 2 '12 at 18:27
thanks very much... – sulistyo Apr 2 '12 at 18:33

Thanks Soulseekah for your answer. i've checked on my /wp-content/plugins/wordpress-seo/admin/linkdex/linkdex.php and what is written there is just exactly the same as you mention/write above, i have : $keywordCount = preg_match_all("/".$job["keyword"]."/msiU", $body, $res); and i don't know what and where the problem is. I try to copy and replace and still nothing happen, the second time i try to re-save my fokus keyword on my post the error was still occur but with different message : "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". For information : this error only occur on one of post only, while the plugin seem to be work well on my others posts. btw, thanks for your answer.. , thank very much...

share|improve this answer
Does your job keyword have a slash in it? Can you var_dump($job["keyword"]); and check please? – soulseekah Apr 2 '12 at 17:55
@Soulseekah: where i should check it.. – sulistyo Apr 2 '12 at 18:02
Just below that 476 line, write a new line and var_dump($job["keyword"]); exit(); then navigate over to the page that gives you the error and see what the keyword was, I'm assuming it has a slash in it... – soulseekah Apr 2 '12 at 18:05
What keyword are you entering to get that error? – soulseekah Apr 2 '12 at 18:06
thanks,i'll try, yes you're right that the my focus keyword (that give me an error) has a slash. – sulistyo Apr 2 '12 at 18:08

Not the answer you're looking for? Browse other questions tagged or ask your own question.