Title: Prevent formatting in code editor
Last modified: September 27, 2017

---

# Prevent formatting in code editor

 *  [candell](https://wordpress.org/support/users/candell/)
 * (@candell)
 * [8 years, 10 months ago](https://wordpress.org/support/topic/prevent-formatting-in-code-editor/)
 * I’m looking for a code snippet or plugin recommendation, I have a customer who
   creates pages in WordPress and adds a paypal button, using code generated from
   PayPal. She goes in to text view in the WordPress wysiwyg and pastes the code,
   the code is of format
 *     ```
       <form action='//paypal.com?kdjhfkjsdhf'>
       <input type='hidden' id=asdas'/>
       <input type='hidden' id=123'/>
       </form>
       ```
   
 * So every new line is seen as a break and places lots of white space around the
   button. I had her remove all line breaks in the editor which removes all of the
   breaks, i.e.
 * `<form action='//paypal.com?kdjhfkjsdhf'><input type='hidden' id=asdas'/><input
   type='hidden' id=123'/></form>`
 * However often when she goes back to the Visual view to continue editing, WordPress
   will remove parts of the paypal code, breaking the button, so she has to go and
   do it again.
 * I remember years ago when I had to insert php in to page content there was a 
   plugin that let me use a shortcode to add the php, is there a html equivalent?
   Such as
 *     ```
       [no-format]
       <form action='//paypal.com?kdjhfkjsdhf'>
       <input type='hidden' id=asdas'/>
       <input type='hidden' id=123'/>
       </form>[/no-format]
       ```
   
 * So that she can use the Visual editor as usual but prevent WordPress from doing
   its thing on the paypal button code?
 * Thanks

Viewing 1 replies (of 1 total)

 *  [stirrell42](https://wordpress.org/support/users/stirrell42/)
 * (@stirrell42)
 * [8 years, 10 months ago](https://wordpress.org/support/topic/prevent-formatting-in-code-editor/#post-9536314)
 * Would you consider doing a shortcode for this? That seems like it might be a 
   good use for a shortcode to me. The hidden items could be set with attributes
   if they need to change page by page. You could do this by writing a simple plug-
   in or adding the shortcode to the functions.php file:
 * [https://codex.wordpress.org/Shortcode_API](https://codex.wordpress.org/Shortcode_API)
 * Sincerely,
    Scott

Viewing 1 replies (of 1 total)

The topic ‘Prevent formatting in code editor’ is closed to new replies.

## Tags

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

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 1 reply
 * 2 participants
 * Last reply from: [stirrell42](https://wordpress.org/support/users/stirrell42/)
 * Last activity: [8 years, 10 months ago](https://wordpress.org/support/topic/prevent-formatting-in-code-editor/#post-9536314)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
