Title: How to add Javascript?
Last modified: March 9, 2021

---

# How to add Javascript?

 *  Resolved [ellmann creative](https://wordpress.org/support/users/ellmanncreative/)
 * (@ellmanncreative)
 * [5 years, 3 months ago](https://wordpress.org/support/topic/how-to-add-javascript-3/)
 * Hey.
 * How would I go about adding JS to the offline page? Whenever I try, the SCRIPT
   tags get stripped and I’m left with plain JS on the website.

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

 *  Thread Starter [ellmann creative](https://wordpress.org/support/users/ellmanncreative/)
 * (@ellmanncreative)
 * [5 years, 3 months ago](https://wordpress.org/support/topic/how-to-add-javascript-3/#post-14155984)
 * What I’m trying to do is create a soft redirect from the offline page. I’m using
   it to mask a staging site, so I would like people to be redirected to the live
   site, but without invoking 3xx.
 *  Plugin Author [WebFactory](https://wordpress.org/support/users/webfactory/)
 * (@webfactory)
 * [5 years, 3 months ago](https://wordpress.org/support/topic/how-to-add-javascript-3/#post-14156895)
 * Hi,
    Sorry, but it’s not possible to add SCRIPT tags unless you modify the plugin
   source.
 *  Thread Starter [ellmann creative](https://wordpress.org/support/users/ellmanncreative/)
 * (@ellmanncreative)
 * [5 years, 3 months ago](https://wordpress.org/support/topic/how-to-add-javascript-3/#post-14160511)
 * Would it be possible to request this functionality? Perhaps a second field that
   would take JS code, and wrap it in <script> tags?
 *  Plugin Author [WebFactory](https://wordpress.org/support/users/webfactory/)
 * (@webfactory)
 * [5 years, 3 months ago](https://wordpress.org/support/topic/how-to-add-javascript-3/#post-14161233)
 * I’ll add it to our to-do list 👍. But nobody requested this before, so I can’t
   guarantee when we’ll add it.
 *  Thread Starter [ellmann creative](https://wordpress.org/support/users/ellmanncreative/)
 * (@ellmanncreative)
 * [5 years, 2 months ago](https://wordpress.org/support/topic/how-to-add-javascript-3/#post-14233219)
 * Sure thing.
 * Alternatively, you could add fields for “soft redirect” or “javascript redirect”
   to another URL, if you feel that allowing JavaScript outright could be a security
   issue. Something like `Redirect to url:` and `Timeout in seconds:` would probably
   work just as well.

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

The topic ‘How to add Javascript?’ is closed to new replies.

 * ![](https://ps.w.org/maintenance/assets/icon-256x256.png?rev=2689583)
 * [Maintenance](https://wordpress.org/plugins/maintenance/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/maintenance/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/maintenance/)
 * [Active Topics](https://wordpress.org/support/plugin/maintenance/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/maintenance/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/maintenance/reviews/)

## Tags

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

 * 5 replies
 * 2 participants
 * Last reply from: [ellmann creative](https://wordpress.org/support/users/ellmanncreative/)
 * Last activity: [5 years, 2 months ago](https://wordpress.org/support/topic/how-to-add-javascript-3/#post-14233219)
 * Status: resolved