Title: Custom Code &#8211; Backslash in JavaScript code removed
Last modified: June 24, 2025

---

# Custom Code – Backslash in JavaScript code removed

 *  Resolved [rjwilt](https://wordpress.org/support/users/rjwilt/)
 * (@rjwilt)
 * [10 months, 3 weeks ago](https://wordpress.org/support/topic/custom-code-backslash-in-javascript-code-removed/)
 * Tried to insert JavaScript code before </head> and got a syntax error. It appears
   that a backslash in a regex was lost. For example, enter this into the ASE configuration:
 *     ```wp-block-code
       <script>  var currentPagePath = window.location.pathname.replace(/\/$/, '');</script>
       ```
   
 * In the site front end, the backslash is missing, resulting in a syntax error.

Viewing 1 replies (of 1 total)

 *  Plugin Author [Bowo](https://wordpress.org/support/users/qriouslad/)
 * (@qriouslad)
 * [10 months, 3 weeks ago](https://wordpress.org/support/topic/custom-code-backslash-in-javascript-code-removed/#post-18526967)
 * [@rjwilt](https://wordpress.org/support/users/rjwilt/) Thank you for reporting
   this. You’re right. In the next release, a checkbox to disable this behaviour,
   i.e. backslash removal, will be added. Preview: [https://www.imagebam.com/view/ME1344EW ](https://www.imagebam.com/view/ME1344EW)
 * If you find ASE useful for your workflow / site(s), please kindly consider leaving
   a quick review at [https://wordpress.org/plugins/admin-site-enhancements/#reviews](https://wordpress.org/plugins/admin-site-enhancements/#reviews).
   Thank you.

Viewing 1 replies (of 1 total)

The topic ‘Custom Code – Backslash in JavaScript code removed’ is closed to new 
replies.

 * ![](https://ps.w.org/admin-site-enhancements/assets/icon-256x256.png?rev=3099794)
 * [Admin and Site Enhancements (ASE)](https://wordpress.org/plugins/admin-site-enhancements/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/admin-site-enhancements/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/admin-site-enhancements/)
 * [Active Topics](https://wordpress.org/support/plugin/admin-site-enhancements/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/admin-site-enhancements/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/admin-site-enhancements/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: [Bowo](https://wordpress.org/support/users/qriouslad/)
 * Last activity: [10 months, 3 weeks ago](https://wordpress.org/support/topic/custom-code-backslash-in-javascript-code-removed/#post-18526967)
 * Status: resolved