I have installed Syntax Highlighter Evolved to simplify code snippets writing and highlighting. I know that it is quite popular and used by many bloggers, so I must be doing something wrong because it drives me mad.

I'm writting my first blog post and I want to include several C# and XML code snippets. I can include one snippet format it as I need but when I continue with second snippet (switching between HTML and Wysiwyg editor and saving draft several times) it sometimes lost formatting of my former snippet (in case of XML it deletes whole snippet). What I'm doing wrong?

I'm using version 3.1.1 of syntax highlighter and WordPress 3.1. I'm writting my post directly in WordPress admin interface.


2 Answers 2


its not the plugins issue, it is problem with wordpress's visual editor. i used this plugin : http://wordpress.org/extend/plugins/tinymce-advanced/ which enabled me to fix and work better, because it have option to disable code stripping. take a look and let me know if it works :)


  • 1
    I installed tinymce-advanced and it is probably even worse. Now I'm absolutely unable to work with xml snippets. Each time I save a draft in HTML mode and after that switch to Visual mode all my XML snippets are deleted. Is there any special configuration I must turn on or do I need to encode all XML element (I tried it already and it looks like Syntax highlighter doesn't like it)? Commented Mar 6, 2011 at 17:22
  • about the formating/code disappearing this was the best suggestion because its a known bug in visual editor, but i have no idea about this plugin ur using. im going to do a little research on that and will get back to u
    – Ayaz Malik
    Commented Mar 6, 2011 at 17:24
  • If you switch between editors it will screw up the formatting. You should be able to use the plugins shortcode in the visual editor. [code]some code[/code] Even if it doesn't look right in the editor it will work once you view the post.
    – Chris_O
    Commented Apr 6, 2011 at 11:43

Try disabling "WordPress should correct invalidly nested XHTML automatically" (under Settings -> Writing).

  • I don't see this "WordPress should correct invalidly nested XHTML automatically" option under my Settings -> Writing, could you point me if I need to configure anything else to see this option? Commented Aug 16, 2016 at 23:56
  • "WordPress should correct invalidly nested XHTML automatically" is the second option from the top of the Writing Settings page. If you're not seeing the option on that page; I'd guess either you don't have sufficient rights to change it or maybe you have another plugin installed that's changing that settings page.
    – Manzabar
    Commented Aug 22, 2016 at 19:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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