Title: Custom Code Not Working
Last modified: December 15, 2016

---

# Custom Code Not Working

 *  [daaan26](https://wordpress.org/support/users/daaan26/)
 * (@daaan26)
 * [9 years, 5 months ago](https://wordpress.org/support/topic/custom-code-not-working/)
 * On my WordPress (which is still in development) I’m trying to add a piece of 
   custom code.
    I’ve tested the custom code in a plain HTML document and it worked
   fine. But when I paste the code in a Code Block on my WordPress it doesn’t work
   anymore.
 * Not let me first explain what the piece of code should do.
    The piece of code
   contains an input form where users should find our companies nearest employee
   based on their zip code. They should enter their 4 digit (Dutch Zipcode’s contain
   only 4 digits) and the code simply checks between which preset values the zipcode
   lies. I’ve made some presets for zipcode i.e. if a user has zipcode 1100, the
   piece of code checks and notices it lies between 1000-2000 (which I put myself
   in the code) and on submit the page redirects to our employee based in Amsterdam(
   which has zipcode around 1060).
 * I use Wordfence and got an error when I first used the form that Wordfence thinks
   it is XSS (Cross-Site Scripting, a type of Security Vulnerability). I tried marking
   this as trusted, but it simply doesn’t work. All it does now is redirect to our
   homepage, no matter what zipcode is filled in the form.
 * I was hoping you guys know some alternatives how to fix this. Maybe a plugin 
   which is able to do this.
    But for now I really don’t know how to handle this.
 * – Daaan26

Viewing 1 replies (of 1 total)

 *  [epicdevspace](https://wordpress.org/support/users/epicdevspace/)
 * (@epicdevspace)
 * [9 years, 4 months ago](https://wordpress.org/support/topic/custom-code-not-working/#post-8566047)
 * Hi Daaan26
 * I highly recommend coding a simple plugin and using a shortcode to output the
   form.
 * If you can post your code I will be happy to point you in the right direction.
 * [You can read up on plugin development here ](https://codex.wordpress.org/Writing_a_Plugin)
 * All the best!

Viewing 1 replies (of 1 total)

The topic ‘Custom Code Not Working’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 1 reply
 * 2 participants
 * Last reply from: [epicdevspace](https://wordpress.org/support/users/epicdevspace/)
 * Last activity: [9 years, 4 months ago](https://wordpress.org/support/topic/custom-code-not-working/#post-8566047)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
