WordPress error resolved – problem while switching from HTML to Visual editor after embedding the code

Wordpress error resolved – problem while switching from HTML to Visual editor after embedding the code

Hi Friends,
Hi faced this error many times but was unable to analyzed the root cause of problem.
Whenever i embedded the code in my blog and come back to edit, sometime the wordpress editor discarded my code. It was not always but often.

How to reproduce the error ?

  1. Go to HTML tab and embed few html code. i am using syntaxhighlighter, so my code is normally like enclosed in square bracket with text “sourcecode”. Go to Visual Tab it works fine.
  2. Again go to HTML tab , save your article and close the window. (Remember you are closing the window when you are on HTML tab).
  3. Now come to your post and navigate to “Visual” tab. you will notice that your HTML code is discarded. Don’t save anything.
  4. Close the window again. (Remember, this time you are closing the window while you was on “Visual” tab.)
  5. Come back again to your post and you will see that your code is just fine.

Conclusion :
If you close your window while you are in “HTML” tab, next time when you will come back it opens the code in same tab (“HTML”) by default and when you switch to “Visual” tab it discards the html code. So to avoid this problem, always close your window when you will be in “Visual” tab.

Related posts