Title: Code changes upon saving
Last modified: August 20, 2016

---

# Code changes upon saving

 *  [The Colour in Between](https://wordpress.org/support/users/thecolourinbetween/)
 * (@thecolourinbetween)
 * [13 years, 9 months ago](https://wordpress.org/support/topic/code-changes-upon-saving/)
 * Hi there,
 * I’ve recently purchased the Daisho theme. They have these lovely social media
   icons that you can put in your footer via a text box.
 * All you have to do is insert code like this:
 *     ```
       <ul id="social">
       	<li><a href="javascript:void(null);"><span class="social-icon">y</span></a></li>
       	<li><a href="javascript:void(null);"><span class="social-icon">t</span></a></li>
       	<li><a href="javascript:void(null);"><span class="social-icon">s</span></a></li>
       	<li><a href="javascript:void(null);"><span class="social-icon">f</span></a></li>
       	<li><a href="javascript:void(null);"><span class="social-icon">m</span></a></li>
       	<li><a href="javascript:void(null);"><span class="social-icon">r</span></a></li>
       	<li><a href="javascript:void(null);"><span class="social-icon">l</span></a></li>
       </ul>
       ```
   
 * Except as soon as I click on save I see it change to:
 *     ```
       <ul>
       	<li><a href="void(null);"><span class="social-icon">y</span></a></li>
       	<li><a href="void(null);"><span class="social-icon">t</span></a></li>
       	<li><a href="void(null);"><span class="social-icon">s</span></a></li>
       	<li><a href="void(null);"><span class="social-icon">f</span></a></li>
       	<li><a href="void(null);"><span class="social-icon">m</span></a></li>
       	<li><a href="void(null);"><span class="social-icon">r</span></a></li>
       	<li><a href="void(null);"><span class="social-icon">l</span></a></li>
       </ul>
       ```
   
 * I’ve disabled all plug ins although I don’t really have that many installed. 
   What could be going wrong?

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

 *  [s_ha_dum](https://wordpress.org/support/users/apljdi/)
 * (@apljdi)
 * [13 years, 9 months ago](https://wordpress.org/support/topic/code-changes-upon-saving/#post-2978728)
 * There is a form that lets you paste in that code? Sounds like that is something
   created by the Daisho theme. Have you asked the creators of that theme for help?
 *  [Pioneer Web Design](https://wordpress.org/support/users/swansonphotos/)
 * (@swansonphotos)
 * [13 years, 9 months ago](https://wordpress.org/support/topic/code-changes-upon-saving/#post-2978730)
 * >  - `<a href="void(null);"></a></li>`
 *  blocked by all major browsers (requires trusted source status) – use an up to
   date theme.
 *  [udaraaka](https://wordpress.org/support/users/udaraaka/)
 * (@udaraaka)
 * [13 years, 9 months ago](https://wordpress.org/support/topic/code-changes-upon-saving/#post-2978731)
 * I think this is because WordPress use some data validation before it insert the
   data into the database. See here
 * [http://codex.wordpress.org/Data_Validation](http://codex.wordpress.org/Data_Validation)
 * If this theme use some core WordPress functions to save this content then your
   code can be affected by Data validation
 * You can check this by creating a sample post (that you can delete later) and 
   putting your above code there. Check the output of that post after saving
 *  Thread Starter [The Colour in Between](https://wordpress.org/support/users/thecolourinbetween/)
 * (@thecolourinbetween)
 * [13 years, 9 months ago](https://wordpress.org/support/topic/code-changes-upon-saving/#post-2978737)
 * Turns out this was the issue from the words of the Theme Developer:
 * “Too bad you didn’t include info that it’s “Text Widget”. They think you’re referring
   to some custom field in admin panel created by us 🙂 The last reply is correct:
   [http://codex.wordpress.org/Data_Validation](http://codex.wordpress.org/Data_Validation)
   but that’s all we know – it uses SOME validation and removes id=”” and leaves
   class=”” intact.
 * I’ll skip investigation on why it removes id=”” and I just fixed it on your server
   by replacing it with class=””. It works on your server. On demo server (also 
   WP 3.4.1) we use id=”” and it doesn’t remove it when I hit “Save” in “Text Widget”.
 * The reason I suspect: your DATABASE (and not WordPress) removes that for some
   reason. That’s rational explanation because we both use WP 3.4.1 on test server
   and your server.”
 *  [udaraaka](https://wordpress.org/support/users/udaraaka/)
 * (@udaraaka)
 * [13 years, 9 months ago](https://wordpress.org/support/topic/code-changes-upon-saving/#post-2978738)
 * I don’t think that this is a problem with your DATABASE. He is just trying to
   hide his faults.
 *  [s_ha_dum](https://wordpress.org/support/users/apljdi/)
 * (@apljdi)
 * [13 years, 9 months ago](https://wordpress.org/support/topic/code-changes-upon-saving/#post-2978739)
 * > The reason I suspect: your DATABASE (and not WordPress) removes that for some
   > reason. That’s rational explanation because we both use WP 3.4.1 on test server
   > and your server.”
 * No way. The database does not selectively remove bits and piece of HTML. That
   is nonsense.
 * Also, not counting functions that completely strip markup, I’ve never noticed
   WordPress data validation functions remove ‘ids’ while leaving ‘classes’. That
   makes no sense from a security standpoint. ‘ids’ aren’t security risks. Possibly
   if you pasted from a Word Processor (like MS Word) you may have had a weird cascade
   that removed the ‘ids’, but I wouldn’t bet on it. It is too targeted.
 *  [udaraaka](https://wordpress.org/support/users/udaraaka/)
 * (@udaraaka)
 * [13 years, 9 months ago](https://wordpress.org/support/topic/code-changes-upon-saving/#post-2978742)
 * Yes It is funny that these half-baked premium themes have more bugs and problems
   than free themes. 😀

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

The topic ‘Code changes upon saving’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 7 replies
 * 4 participants
 * Last reply from: [udaraaka](https://wordpress.org/support/users/udaraaka/)
 * Last activity: [13 years, 9 months ago](https://wordpress.org/support/topic/code-changes-upon-saving/#post-2978742)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
