Title: WordPress 2.1 always format my code
Last modified: August 18, 2016

---

# WordPress 2.1 always format my code

 *  [spikesoft](https://wordpress.org/support/users/spikesoft/)
 * (@spikesoft)
 * [19 years, 4 months ago](https://wordpress.org/support/topic/wordpress-21-always-format-my-code/)
 * Till version 2.1 wordpress has just decided to always reformat my code. I wrote
   in the editor (not visual) the fellowing code:
 * <script src=”[http://www.spikesoft.ch/wordpress/wp-content/radarpicture/meteo.js&#8221](http://www.spikesoft.ch/wordpress/wp-content/radarpicture/meteo.js&#8221);
   type=”text/javascript”></script>
    <script type=”text/javascript”> window.onload
   = SetDefaultDates; </script> <div class=”animation”>Radar’s picture from <input
   type=”text” id=”vonDatum” /> at <input type=”text” id=”vonZeit” /> to <input 
   type=”text” id=”bisDatum” /> at <input type=”text” id=”bisZeit” />       <input
   name=”_ctl1:derButton” id=”_ctl1_derButton” type=”button” value=”animate” class
   =”mybutton” onclick=”PrepareAnimation()” /> <span id=”DatumFehler” style=”display:
   none”>Date is not valid. Valid format ‘dd.mm.yyyy'</span> <span id=”ZeitFehler”
   style=”display:none”>Time is not valid. Valid fomrat ‘hh24:mm'</span> <span id
   =”keineDaten” style=”display:none”></span> </div>
 * Explanation about this image can be found [here](http://www.meteosuisse.ch/web/fr/meteo/temps_actuel/image_radar/informations.html)(
   french only).
 * Image of <span id=”datum”></span>
    <div class=”radarrahmen”> <div class=”radarbild”
   > <img id=”radar” src=”[http://img.landimeteo.ch/meteodata/radaranimiert.gif&#8221](http://img.landimeteo.ch/meteodata/radaranimiert.gif&#8221);
   alt=”” /> <img src=”[http://img.landimeteo.ch/meteodata/skala.gif&#8221](http://img.landimeteo.ch/meteodata/skala.gif&#8221);
   alt=”Skala” id=”skala”/> </div>
 * </div>
 * and It’s always displayed as:
    <p>` <script src="http://www.spikesoft.ch/wordpress/
   wp-content/radarpicture/meteo.js" type="text/javascript"></script> <script type
   ="text/javascript"> window.onload = SetDefaultDates; </script> <div class="animation"
   ><p>Radar’s picture from</p>
 * <input type="text" id="vonDatum" /> at</p>
    <input type="text" id="vonZeit" /
   > to</p> <input type="text" id="bisDatum" /> at</p> <input type="text" id="bisZeit"/
   >      </p> <input name="_ctl1:derButton" id="_ctl1_derButton" type="button" 
   value="animate" class="mybutton" onclick="PrepareAnimation()" /> <span id="DatumFehler"
   style="display:none">Date is not valid. Valid format ‘dd.mm.yyyy’</span>
 *  <span id="ZeitFehler" style="display:none">Time is not valid. Valid fomrat ‘
   hh24:mm’</span>
    <span id="keineDaten" style="display:none"></span> </div> <p
   >Explanation about this image can be found [here](http://www.meteosuisse.ch/web/fr/meteo/temps_actuel/image_radar/informations.html)(
   french only). </p> <p>Image of <span id="datum"></span></p> <div class="radarrahmen"
   > <div class="radarbild">
 *  <p><img id="radar" src="http://img.landimeteo.ch/meteodata/radaranimiert.gif"
   alt="" />
    <img src="http://img.landimeteo.ch/meteodata/skala.gif" alt="Skala"
   id="skala"/> </div> </div> <p></p>
 * Even if I hack directly in the database this damned version 2.1 still find sensefull
   to reinterpret my code, that is add some fancy <p></p>.
 * Did I miss a new option of version 2.1. How to fix this very annoying behaviour.
 * Thanks in advance. Jerome

Viewing 13 replies - 1 through 13 (of 13 total)

 *  [miccom](https://wordpress.org/support/users/miccom/)
 * (@miccom)
 * [19 years, 3 months ago](https://wordpress.org/support/topic/wordpress-21-always-format-my-code/#post-513378)
 * I have not the same, but a similar problem. WP is hiding my images, which I put
   into my topic.
 * I use this image-tag:
    <img src=”[http://www.greensmilies.com/images/banner_001.gif&#8221](http://www.greensmilies.com/images/banner_001.gif&#8221);
   alt=”GreenSmilies.com – Die Welt der Smilies ist nicht immer nur gelb!” width
   =”468″ height=”60″ />
 * And WP 2.0.8 and 2.1 make this:
    <img src=”[http://www.greensmilies.com/images/banner_001.gif&#8221](http://www.greensmilies.com/images/banner_001.gif&#8221);
   style=”display: none;” alt=”GreenSmilies.com – Die Welt der Smilies ist nicht
   immer nur gelb!” height=”60″ width=”468″>
 * You can see (or better, you can’t see) it also on my test blog:
    [http://miccom.wordpress.de/](http://miccom.wordpress.de/)
 *  [veola](https://wordpress.org/support/users/veola/)
 * (@veola)
 * [19 years, 3 months ago](https://wordpress.org/support/topic/wordpress-21-always-format-my-code/#post-513379)
 * By default, the visual posting box is NOT activated. It is not like wp2.0 any
   more, but you can activate the visual edit box in administrator’s manage panel.
 * Login into manage panel —> users —> (chose your username)edit —> Your Profile
 * and check “Use the visual editor when writing” —>click “update profile”
 * and return to the posting page, you will see the visual posting panel you want.
 * hoping my reply can give you some help
 *  [miccom](https://wordpress.org/support/users/miccom/)
 * (@miccom)
 * [19 years, 3 months ago](https://wordpress.org/support/topic/wordpress-21-always-format-my-code/#post-513381)
 * Thanks veola, but we both are using the editor without the wysiwyg-option.
 *  [veola](https://wordpress.org/support/users/veola/)
 * (@veola)
 * [19 years, 3 months ago](https://wordpress.org/support/topic/wordpress-21-always-format-my-code/#post-513384)
 * Actually, by checking “Use the visual editor when writing” option, the default
   editor will be set to be “wysiwyg” but there’s is no HTML CODE EDITOR any more.
   It’s really a big problem. some html tag symbols will be reformatted when you
   click “post” button.
 * eg.
    you type `var book={title:'bookTitle', author:'nate', id:222};`
 * and click “post”
 * the code you typed will be change to be
    `var book={title:’bookTitle’, author:’
   nate’, id:222};`
 * I don’t know why wp’s dev team change the editor worse than version 2.0
 *  [ekusteve](https://wordpress.org/support/users/ekusteve/)
 * (@ekusteve)
 * [19 years, 3 months ago](https://wordpress.org/support/topic/wordpress-21-always-format-my-code/#post-513386)
 * I had the same problem [spikesoft] explains above after upgrading to 2.1. I like
   using the rich text editor just for simplicity, but it was keeping me from being
   able to embed movies from YouTube on my site. I don’t have the problem if I disable
   the rich text editor…uncheck it in my profile.
 * So, what I ended up doing was to create a second administrator account for myself
   and set it NOT use the rich text editor. When I want to embed some code, I log
   in on that second account….for my normal posts, I log in on my primary account
   so I’ll have the rich text editor by default.
 * Steve
 *  [veola](https://wordpress.org/support/users/veola/)
 * (@veola)
 * [19 years, 3 months ago](https://wordpress.org/support/topic/wordpress-21-always-format-my-code/#post-513387)
 * by the way, I’m trying to repot the editor of wp2.0 to wp2.1.
 * It sounds very insinuative，but honestly, i think wp2.0’s editor is better.
 * I will share the method of repoting the editor if i get though.
 *  [Doodlebee](https://wordpress.org/support/users/doodlebee/)
 * (@doodlebee)
 * [19 years, 3 months ago](https://wordpress.org/support/topic/wordpress-21-always-format-my-code/#post-513388)
 * [Solution to running javascript from within a post](http://wordpress.org/support/topic/32967?replies=9).
 * Use Lorelle’s version – works like a charm.
 *  [syncbox](https://wordpress.org/support/users/syncbox/)
 * (@syncbox)
 * [19 years, 3 months ago](https://wordpress.org/support/topic/wordpress-21-always-format-my-code/#post-513393)
 * I am finding that the code editor for posts is changing divs to p tags! WTF? 
   Even if I paste the correct stuff back in, any edit to the page/post causes this
   freaking corruption again…
 * what the hell is that all about?
 *  [adriangab](https://wordpress.org/support/users/adriangab/)
 * (@adriangab)
 * [19 years, 3 months ago](https://wordpress.org/support/topic/wordpress-21-always-format-my-code/#post-513394)
 * also, 2.1 by default appears to add in strange P tags and if you open a previously
   saved post it changes DIV tags to P tags. I fixed both of these issues by following
   the two fixes on this article:
 * [http://wordpress.org/support/topic/102799](http://wordpress.org/support/topic/102799)
 * One issue is a config change to do with the TinyMCE WYSIWYG editor and another
   with the formatting.php file in the wp-includes directory
 *  [Nicki Faulk](https://wordpress.org/support/users/nitallica/)
 * (@nitallica)
 * [19 years, 3 months ago](https://wordpress.org/support/topic/wordpress-21-always-format-my-code/#post-513402)
 * I’m glad I’m not the only one having this problem. WP is putting my each of my
   form elements on individual lines, despite my taking them out when using the 
   text editor.
 * Would love to see some feedback/response from a moderator or developer with an
   official word on this. 😛
 * Nicki
 *  [miccom](https://wordpress.org/support/users/miccom/)
 * (@miccom)
 * [19 years, 3 months ago](https://wordpress.org/support/topic/wordpress-21-always-format-my-code/#post-513415)
 * I withdraw my request in the second post, it isn’t an WP issue, it was my Adblocker…
   🙁 *shame on me*
 *  [rost](https://wordpress.org/support/users/rost/)
 * (@rost)
 * [18 years, 9 months ago](https://wordpress.org/support/topic/wordpress-21-always-format-my-code/#post-513438)
 * **I have found a solution for effective embedding Javascript code in the WordPress
   posts** (this is for WP2.2.2 which i use)
 * While I failed to suppress or disable script code formatting in the WP options,
   I found that using external scripts can solve this problem effectively. WordPress
   still wraps my scripts in the paragraphs, but now scripts work.
 * So, instead of writing javascript code directly in the page, it is better to 
   externalize the script to file and refer to it like this:
 * <script type=”text/javascript” language=”javascript” src=”[http://flash-ripper.com/tools/firefox/search/”></script&gt](http://flash-ripper.com/tools/firefox/search/”></script&gt);(
   I’ve applied this solution at the my blog page where I embed javascript for adding
   my own [Firefox Search plug-ins for Flash, Flex, and Adobe Labs](http://flash-ripper.com/en/firefox-search-plugins-flash-flex-air-actionscript-adobe-labs/))
 * Hope this will help someone. However, if I had better solution, I’d be glad, 
   so maybe someone can tell me how to stop auto code formatting in the WP2.1.
 * Otherwise, I’ll be forced to write my own wordpress plug-in for intelligent javascript
   embedding! 🙂
 *  [gabosgab](https://wordpress.org/support/users/gabosgab/)
 * (@gabosgab)
 * [18 years, 7 months ago](https://wordpress.org/support/topic/wordpress-21-always-format-my-code/#post-513443)
 * Hey Rost, thanks for the tip. I tried that and it worked perfectly. I had a terrible
   problem with WordPress treating javascript as text and inserting <P> tags all
   over the place. Thanks again!

Viewing 13 replies - 1 through 13 (of 13 total)

The topic ‘WordPress 2.1 always format my code’ is closed to new replies.

## Tags

 * [formatting](https://wordpress.org/support/topic-tag/formatting/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 13 replies
 * 10 participants
 * Last reply from: [gabosgab](https://wordpress.org/support/users/gabosgab/)
 * Last activity: [18 years, 7 months ago](https://wordpress.org/support/topic/wordpress-21-always-format-my-code/#post-513443)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
