Title: onClick code being stripped
Last modified: July 20, 2018

---

# onClick code being stripped

 *  [rperyer10](https://wordpress.org/support/users/rperyer10/)
 * (@rperyer10)
 * [7 years, 10 months ago](https://wordpress.org/support/topic/onclick-code-being-stripped/)
 * Every time I try and add some onclick code into my footer, it gets stripped out
   as soon as i hit save. Does anyone know how to stop WordPress from doing this?
 * this is an example of the code I am trying to use
 * [Jon Doe](https://wordpress.org/support/topic/onclick-code-being-stripped/webmaster@example.com?output_format=md)

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

 *  Thread Starter [rperyer10](https://wordpress.org/support/users/rperyer10/)
 * (@rperyer10)
 * [7 years, 10 months ago](https://wordpress.org/support/topic/onclick-code-being-stripped/#post-10511437)
 * Code is this
 * “mailto:webmaster@example.com” onclick=”gtag(‘event’, ‘Click Email Address’, {‘
   event_category’: ‘Email’,’event_label’: ‘Footer Email Address’});”>Jon Doe
 *  [HudsonValleyWebDesign](https://wordpress.org/support/users/jaycbrf/)
 * (@jaycbrf)
 * [7 years, 10 months ago](https://wordpress.org/support/topic/onclick-code-being-stripped/#post-10512015)
 * Where are you putting this code? In a widget or in the footer php template?
 *  Thread Starter [rperyer10](https://wordpress.org/support/users/rperyer10/)
 * (@rperyer10)
 * [7 years, 10 months ago](https://wordpress.org/support/topic/onclick-code-being-stripped/#post-10512073)
 * in a content block widget I think (I’m new to this so not 100% sure!)
 *  [HudsonValleyWebDesign](https://wordpress.org/support/users/jaycbrf/)
 * (@jaycbrf)
 * [7 years, 10 months ago](https://wordpress.org/support/topic/onclick-code-being-stripped/#post-10519887)
 * I do not believe you can add javscript in widgets.

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

The topic ‘onClick code being stripped’ is closed to new replies.

## Tags

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

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 4 replies
 * 2 participants
 * Last reply from: [HudsonValleyWebDesign](https://wordpress.org/support/users/jaycbrf/)
 * Last activity: [7 years, 10 months ago](https://wordpress.org/support/topic/onclick-code-being-stripped/#post-10519887)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
