Title: &lt;code&gt;-tag not functioning properly?
Last modified: August 19, 2016

---

# <code>-tag not functioning properly?

 *  Resolved [chartinael](https://wordpress.org/support/users/chartinael/)
 * (@chartinael)
 * [16 years, 5 months ago](https://wordpress.org/support/topic/ltcodegt-tag-not-functioning-properly/)
 * Hi guys,
 * I have a draft post where I store all the wp body edits I had to make in order
   for wordpress to do what I need it to do.
 * I enter location and code to be changed.
 * The code I put between the code-tag but somehow it does get parsed.
 * so i.e. I end up with
 *     ```
       Line xyz
       <code>
       $pee = preg_replace('/<p>\s*?(' . get_shortcode_regex() . ')\s*< \/p>/s', '$1', $pee); // don't auto-p wrap shortcodes that stand alone
       </p></code>
       ```
   
 * where the `</p>` was added by wordpress’ tag closing feature. And thus it displays
   on preview an nicely added paragraph so I know that the code inside the code-
   tags does get parsed.
 * or at another place it closes a `<code>`-tag even though there are no open code-
   tags at all.
 * Anyhow, is this a bug? is there anywhere I can look and adjust code to make it
   work?

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

 *  [esmi](https://wordpress.org/support/users/esmi/)
 * (@esmi)
 * [16 years, 5 months ago](https://wordpress.org/support/topic/ltcodegt-tag-not-functioning-properly/#post-1302458)
 * The `<code></code>` tags are just markup. They don’t escape your code or stop
   it being parsed. You need to encode all opening `<` and closing `>` tags to stop
   it being parsed.
 * Additionally the `<code></code>` are **inline** markup elements which means that
   they should be enclosed in a block-level element such as `<p></p>`, `<div></div
   >` or `<pre></pre>`. So WP is acting correctly in this instance. Personally, 
   I enclose blocks of pre-encoded scripting for display inside `<pre><code></code
   ></pre>` tags and WP doesn’t interfere at all.
 *  Thread Starter [chartinael](https://wordpress.org/support/users/chartinael/)
 * (@chartinael)
 * [16 years, 5 months ago](https://wordpress.org/support/topic/ltcodegt-tag-not-functioning-properly/#post-1302463)
 * so how does this code tag here in the forum function? Cause it does what I thought
   the code button in the wp editor ought to be doing?
 *  Thread Starter [chartinael](https://wordpress.org/support/users/chartinael/)
 * (@chartinael)
 * [16 years, 5 months ago](https://wordpress.org/support/topic/ltcodegt-tag-not-functioning-properly/#post-1302473)
 * [http://www.thunderguy.com/semicolon/wordpress/code-markup-wordpress-plugin/](http://www.thunderguy.com/semicolon/wordpress/code-markup-wordpress-plugin/)
 * This plugin does the job and assigns the `<code>`-tag with the appropriate functionality.

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

The topic ‘<code>-tag not functioning properly?’ is closed to new replies.

## Tags

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

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 3 replies
 * 2 participants
 * Last reply from: [chartinael](https://wordpress.org/support/users/chartinael/)
 * Last activity: [16 years, 5 months ago](https://wordpress.org/support/topic/ltcodegt-tag-not-functioning-properly/#post-1302473)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
