Warning: Compilation failed error

Are you suffering from:

Warning: Compilation failed: characters with values > 255 are not yet supported in classes at offset 16 in /path/to/website/blog/wp-includes/shortcodes.php on line xxx.

Fix it by changing a line  in /wp-includes/shortcodes.php. Look for the section headed “function shortcode_parse_atts($text)” and change the preg_replace line with

$text = preg_replace("/[\x{00a0}\x{ff}]+/u", " ", $text);

This maintains the functionality but only includes the supported characters.

This error occurs when using a version of PHP with an outdated PCRE library.

3 thoughts on “Warning: Compilation failed error”

  1. When using the RSS feed widgit we also found it necessary to edit class-simplepie.php in the same way:

    we replaced
    return (bool) preg_match(‘/^([A-Za-z0-9\-._~\x{A0}-\x{D7FF}\x{F900}-\x{FDCF}\x{FDF0}-\x{
    BFFFD}\x{C0000}-\x{CFFFD}\x{D0000}-\x{DFFFD}\x{E1000}-\x{EFFFD}!$&\'()*+,;[email protected]]|(%[0-9ABCDEF]{2}))+$/u’, $


    return (bool) preg_match('/[\x{00a0}\x{ff}]+/u', $string);

  2. Thanks a lot for posting about this Rex, very helpful indeed. My server was using quite an old version of PHP so this had to be changed.

    Also thanks to admin for the second part of that code, it’s a symptom of the old PHP version that affects both, so I think anyone needing to do one of these fixes will need to do both.

Comments are closed.