Title: Does WordPress Break the `PRE` Element?
Last modified: August 20, 2016

---

# Does WordPress Break the `PRE` Element?

 *  [brentontherefore](https://wordpress.org/support/users/brentontherefore/)
 * (@brentontherefore)
 * [13 years, 2 months ago](https://wordpress.org/support/topic/does-wordpress-break/)
 * As we all know, the HTML `<pre>` tag means preformatted text, and is used to 
   do things like preserve the white-spaces in preformatted text, so that if I use
   spaces to align some text like this:
 *     ```
       0
        1
         2
          3
           4
            5
             6
       ```
   
 * it will look like that, instead of letting HTML do it’s thing to collapse it 
   and making it look like this:
 *     ```
       0 1 2 3 4 5 6
       ```
   
 * or this
 *     ```
       0
       1
       2
       3
       4
       5
       6
       ```
   
 * So why does WordPress strip out concurrent spaces before even sending code to
   the browser, even inside a `<pre>` tag? When I view the source and look at my`
   <pre>` element, the white spaces aren’t there, WordPress has entirely removed
   them. HTML never has a chance to preformat it, the spaces are gone. This defeats
   the purpose of `<pre>` altogether. Yet I’ve seen people using the `<pre>` tag
   on WordPress sites and their spaces show up fine. Is this something recently 
   broken in 3.5.1??

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

 *  [Rajesh Soni](https://wordpress.org/support/users/rajeshsoni/)
 * (@rajeshsoni)
 * [13 years, 2 months ago](https://wordpress.org/support/topic/does-wordpress-break/#post-3573420)
 * Have you tried using `<xmp>` instead?
 *  Thread Starter [brentontherefore](https://wordpress.org/support/users/brentontherefore/)
 * (@brentontherefore)
 * [13 years, 2 months ago](https://wordpress.org/support/topic/does-wordpress-break/#post-3573484)
 * That tag is not valid HTML. I believe it wasn’t even valid in HTML 4.01.
 *  Thread Starter [brentontherefore](https://wordpress.org/support/users/brentontherefore/)
 * (@brentontherefore)
 * [13 years, 2 months ago](https://wordpress.org/support/topic/does-wordpress-break/#post-3573606)
 * I have a similar question on wordpress.stackexchange with a bounty of +50 if 
   you can answer it. It expires soon though.
 * [http://wordpress.stackexchange.com/questions/90065/preserve-white-space-in-page](http://wordpress.stackexchange.com/questions/90065/preserve-white-space-in-page)
 *  [WPyogi](https://wordpress.org/support/users/wpyogi/)
 * (@wpyogi)
 * [13 years, 2 months ago](https://wordpress.org/support/topic/does-wordpress-break/#post-3573609)
 * Just tested it in twentytwelve – worked fine. But be sure you are using “text”
   editor and not switching between the “text” and “visual” editors as that WILL
   strip code.
 *  Thread Starter [brentontherefore](https://wordpress.org/support/users/brentontherefore/)
 * (@brentontherefore)
 * [13 years, 2 months ago](https://wordpress.org/support/topic/does-wordpress-break/#post-3573610)
 * I’m definitely just using the HTML text editor. twentytwelve is a theme–which
   version of WordPress are you using?
 *  [WPyogi](https://wordpress.org/support/users/wpyogi/)
 * (@wpyogi)
 * [13 years, 2 months ago](https://wordpress.org/support/topic/does-wordpress-break/#post-3573613)
 * 3.5.1
 *  Thread Starter [brentontherefore](https://wordpress.org/support/users/brentontherefore/)
 * (@brentontherefore)
 * [13 years, 2 months ago](https://wordpress.org/support/topic/does-wordpress-break/#post-3573614)
 * Agh. This is so frustrating–why does yours work but mine does not?
 *  [WPyogi](https://wordpress.org/support/users/wpyogi/)
 * (@wpyogi)
 * [13 years, 2 months ago](https://wordpress.org/support/topic/does-wordpress-break/#post-3573615)
 * Dunno, what theme are you using? Have you tried deactivating your plugins?

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

The topic ‘Does WordPress Break the `PRE` Element?’ is closed to new replies.

## Tags

 * [code](https://wordpress.org/support/topic-tag/code/)
 * [indentation](https://wordpress.org/support/topic-tag/indentation/)
 * [pre](https://wordpress.org/support/topic-tag/pre/)
 * [spaces](https://wordpress.org/support/topic-tag/spaces/)
 * [white-space](https://wordpress.org/support/topic-tag/white-space/)
 * [whitespace](https://wordpress.org/support/topic-tag/whitespace/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 8 replies
 * 3 participants
 * Last reply from: [WPyogi](https://wordpress.org/support/users/wpyogi/)
 * Last activity: [13 years, 2 months ago](https://wordpress.org/support/topic/does-wordpress-break/#post-3573615)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
