How to Fix ‘Headers Already Sent’ Error in Urvanov Syntax Highlighter

If you wrote a comment in this blog in the past weeks, you got an error like this one:

Warning: Attempt to read property “comment_ID” on null in /home/*/class-urvanov-syntax-highlighter-plugin.php on line 714 Warning: Attempt to read property “comment_ID” on null in /home/*/class-urvanov-syntax-highlighter-plugin.php on line 724 Warning: Cannot modify header information – headers already sent by (output started at /home/*/class-urvanov-syntax-highlighter-plugin.php:714)…

I didn’t notice this problem until Charles send me an e-mail. I started googling for a solution but found nothing that would work. That was until I went through the old issues on GitHub, and lo and behold, there was a related problem.

Should you run into the same problem, you can deactivate the syntax highlighting for comments in the plugin settings for Urvanov Syntax Highlighter:

The settings dialog has a section Misc in which you can uncheck the option for comments

Uncheck the box for the option “Allow Crayons inside comments” and the problem is gone.

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.