Title: Loosing changes after saving edit
Last modified: March 30, 2023

---

# Loosing changes after saving edit

 *  Resolved [Oscar Otero](https://wordpress.org/support/users/oscarotero/)
 * (@oscarotero)
 * [3 years ago](https://wordpress.org/support/topic/loosing-changes-after-saving-edit/)
 * Every time I save my changes the page refreshes and shows the previews code, 
   making me loose all my work.
 * *WordPress Version: 6.2, Code Type: Javascript, Linking Type: Internal, Where
   on page: head, Where in site: In Admin
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Floosing-changes-after-saving-edit%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

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

 *  Plugin Author [SilkyPress](https://wordpress.org/support/users/diana_burduja/)
 * (@diana_burduja)
 * [3 years ago](https://wordpress.org/support/topic/loosing-changes-after-saving-edit/#post-16612160)
 * What is “previews code”? Or do you mean “previous code”?
 * So, when editing a custom JS code, after clicking the “Update” button the changes
   are lost and the editor shows you the code before the changes?
 * If you inspect the website’s HTML on the frontend, is the JS code shown with 
   or without the changes?
 * If you add a new custom JS code the changes are saved alright?
 * Do you have any caching plugins installed on the website?
    -  This reply was modified 3 years ago by [SilkyPress](https://wordpress.org/support/users/diana_burduja/).
 *  Thread Starter [Oscar Otero](https://wordpress.org/support/users/oscarotero/)
 * (@oscarotero)
 * [3 years ago](https://wordpress.org/support/topic/loosing-changes-after-saving-edit/#post-16622978)
 * Sorry for my bad english.
 * Yes, after clicking the “Update” button the changes are lost and the editor shows
   me the code that at some point was saved.
 * If I inspect the HTML in the Admin area (/wp-admin) the new changes are not showing.
 * If I add a new custome JS happend the same thing.
 * No I don’t have any caching plugin. But anyway I deactivated all my other plugins
   and try in a different browser and happened the same thing.
 *  Plugin Author [SilkyPress](https://wordpress.org/support/users/diana_burduja/)
 * (@diana_burduja)
 * [3 years ago](https://wordpress.org/support/topic/loosing-changes-after-saving-edit/#post-16628966)
 * Does this happen every time you add/edit a custom code, or only for some custom
   codes?
 * Could you make me some screenshots of the “Edit JS code” page before the modifications,
   after modifications and after clicking the “Update” button? (Use the [imgur.com](https://imgur.com/)
   site to upload the screenshots and link them here).
 *  Thread Starter [Oscar Otero](https://wordpress.org/support/users/oscarotero/)
 * (@oscarotero)
 * [3 years ago](https://wordpress.org/support/topic/loosing-changes-after-saving-edit/#post-16648776)
 * Yes this happens every time.
 * I uploaded the screen shots. Here is the link: [https://imgur.com/a/G6uqnBD](https://imgur.com/a/G6uqnBD)
 *  Plugin Author [SilkyPress](https://wordpress.org/support/users/diana_burduja/)
 * (@diana_burduja)
 * [3 years ago](https://wordpress.org/support/topic/loosing-changes-after-saving-edit/#post-16649570)
 * In your second screenshot the editor’s line numbers are missing, as well as the
   syntax highlighting (the color for the ‘Testing’ string should be red). On my
   side it looks [like this](https://imgur.com/eqTU6jA).
 * Would you try the following: open the “Add Custom JS” page and open the browser’s
   console (hit “Ctrl + Shift + I” and choose the “Console” tab) on that page. Then
   add “alert(‘Testing’);” as content in the code editor and see if there are any
   JS errors showing up in the browser’s console. Would you make me a screenshot
   of the page together with all the errors the browser’s console?
 *  Thread Starter [Oscar Otero](https://wordpress.org/support/users/oscarotero/)
 * (@oscarotero)
 * [3 years ago](https://wordpress.org/support/topic/loosing-changes-after-saving-edit/#post-16652407)
 * No, there is no console error.
 * Diana the problem was solved after moving one custom JS record to the trash. 
   Aparently there was a conflict or something wierd with that entry. I don’t know
   if this can help but the JS insidet this one was:
 *     ```wp-block-code
       jQuery(document).ready(function( $ ){
           $('#wpcontent').html($('#wpbody').html().replace('Processed', 'Processed'));
   
       });
       ```
   
 * I was trying to change the first parameter in replace() and it was when the problem
   begin.
 * Another thing that maybe can help is that I work with multiple tabs at the same
   time and I copy/paste a lot from one to another.
 *  Thread Starter [Oscar Otero](https://wordpress.org/support/users/oscarotero/)
 * (@oscarotero)
 * [3 years ago](https://wordpress.org/support/topic/loosing-changes-after-saving-edit/#post-16652437)
 * The editor is ignoring the code I paste and when I save the issue begins.
 *  Plugin Author [SilkyPress](https://wordpress.org/support/users/diana_burduja/)
 * (@diana_burduja)
 * [3 years ago](https://wordpress.org/support/topic/loosing-changes-after-saving-edit/#post-16653382)
 * I’m a bit confused about the state of the issue. First you said that “the problem
   was solved …”, but then in the second message “the editor is ignoring … and the
   issue begins”. Did you find a solution or not? The aforementioned JS code snippet
   still doesn’t help me replicate your issue.

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

The topic ‘Loosing changes after saving edit’ is closed to new replies.

 * ![](https://ps.w.org/custom-css-js/assets/icon-128x128.png?rev=1303730)
 * [Simple Custom CSS and JS](https://wordpress.org/plugins/custom-css-js/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/custom-css-js/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/custom-css-js/)
 * [Active Topics](https://wordpress.org/support/plugin/custom-css-js/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/custom-css-js/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/custom-css-js/reviews/)

## Tags

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

 * 8 replies
 * 2 participants
 * Last reply from: [SilkyPress](https://wordpress.org/support/users/diana_burduja/)
 * Last activity: [3 years ago](https://wordpress.org/support/topic/loosing-changes-after-saving-edit/#post-16653382)
 * Status: resolved