Title: How do I run Javascript within a post?
Last modified: August 18, 2016

---

# How do I run Javascript within a post?

 *  [scottallen](https://wordpress.org/support/users/scottallen/)
 * (@scottallen)
 * [21 years, 10 months ago](https://wordpress.org/support/topic/how-do-i-run-javascript-within-a-post/)
 * I have a piece of JS code I want to run within a post, but all the quotes — single
   or double — get converted into escape codes and the code doesn’t run. What can
   I use that won’t get converted so the code will run?

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

 *  [mattread](https://wordpress.org/support/users/mattread/)
 * (@mattread)
 * [21 years, 10 months ago](https://wordpress.org/support/topic/how-do-i-run-javascript-within-a-post/#post-71685)
 * You could try taking out the “wp-texturize” filter in /wp-includes/vars.php. 
   it’s at the very bottom of that file, just comment it out like this:
    //add_filter(‘
   the_content’, ‘wptexturize’); I’m not sure if that is going to do it for you 
   though. What’s the JS you want to run? Also any “texturize” or other plugins 
   might be doing that as well.
 *  Thread Starter [scottallen](https://wordpress.org/support/users/scottallen/)
 * (@scottallen)
 * [21 years, 10 months ago](https://wordpress.org/support/topic/how-do-i-run-javascript-within-a-post/#post-71688)
 * I have a couple of pieces of code I want to run. One is the Amazon affiliate 
   code where it’s hosted on their site. Another is some code that displays photos
   of members from another site who are online right now. Pretty hard to run _any_
   Javascript code without any quote marks. Also, if I remove that filter, that 
   will impact all my other posts. I’d like to just be able to shut it off for one
   post, or to have some input character that would produce the correct output characters
   so I could make the code execute.
 *  [mattread](https://wordpress.org/support/users/mattread/)
 * (@mattread)
 * [21 years, 10 months ago](https://wordpress.org/support/topic/how-do-i-run-javascript-within-a-post/#post-71708)
 * Are you sure it will impact your other posts that much. I find it does more harm
   than good. I use the “markdown” plugin and disable the wp-texturize, and it works
   great for me. You should try it and see.

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

The topic ‘How do I run Javascript within a post?’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 3 replies
 * 2 participants
 * Last reply from: [mattread](https://wordpress.org/support/users/mattread/)
 * Last activity: [21 years, 10 months ago](https://wordpress.org/support/topic/how-do-i-run-javascript-within-a-post/#post-71708)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
