How to insert Code in Wordpress post
I think many people have problem when insert code in their Wordpress post or comments. For example if you are developer or if you have found some code in the Internet and want to share it with your readers then maybe you will meet some difficulties.
If you just copy and paste code in its original format into your post it will try to work like code and execute its commands. By default Wordpress will convert it and as a result you will receive unpredictable results like strange pages or missing symbols in your code or it may just disappear.
In order to publish code into a post it must be converted to a text suitable for publication. It could be made by hand with replacing the following characters with their substitutes.
” = "
& = &
< = <
> = >
But there is an easier way to do this using one of the following online converters.
Go to one of the above sites and paste your code to the empty field. Then click on Encode and you will have new converted code ready for posting.
Note: When inserting your code use HTML mode of Wordpress editor not Visual .
Now place <code> and </code> in your post and paste converted code between these tags. This method worked for me.
Good luck.


