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

share|improve this question
make sure you are closing the shortcode tags [xml] code ... [/xml] before switching between HTML and Wysiwyg – Bainternet Mar 6 '11 at 16:04

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 :)


share|improve this answer
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)? – Ladislav Mrnka Mar 6 '11 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 Mar 6 '11 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 Apr 6 '11 at 11:43

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

share|improve this answer
Thanks it helped! – imesh Jun 17 '14 at 2:31

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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