Create a Zip Code Search in WordPress

VIDEO TRANSCRIPTION

This video is going to show you how to create a zip code search for a website. It’s a really great way to get users interacting with your site especially if you have like a delivery type of business or have a specific service area. Let’s get started. In WP Triggers you want to click on “add new” and we’re going to call this trigger box “Zip Code Search.”

There’s going to be a question above this box. The question is going to say, “Enter your zip code to see if we deliver to your area.” Let’s make believe it’s a pizza place, okay? It delivers pizza. If a visitor types in let’s say the zip codes are 00001 and then 00002, 00003, 00004. We’re going to make believe these are the zip codes that this pizza place delivers to. Those are the five.

If the visitor types that in, what should display is something like, “Yes we deliver to your area. Call us today and order a pizza.” If they type in any other zip code other than these four here, what should it say? It should say something like, “No, sorry we do not deliver to you.” I would also recommend unchecking the “hide this trigger box” in case someone wants to try a different zip code.

Once we’ve got the zip codes, we’ve got the “Yes, we deliver to your area” message and then the “No, sorry we do not deliver to you” message. Click on “save changes.” Now, let’s copy the short code and let’s go add a new page. We’ll call this “Zip Code Search.” Then it will be “Type in your zip code to see if we deliver to your area.”

I’m just going to right-click underneath that and choose “paste.” We’ll just paste in the short code and then click “publish.” Then let’s view the page. “Type in your zip code to see if we deliver to you.” Let’s try the zip code 12345. It says, “No, sorry we do not deliver to you.” What about 7894? No. They don’t deliver here. But what if I was in 00003? “Yes, we deliver to your area. Call us today and order a pizza.” It’s as easy as that.

But let’s take this tab further. Let’s go back and let’s edit our trigger box. Go back to WP Triggers and all triggers and let’s edit the “zip code search” one. Let’s say that this pizza shop for whatever reason also delivers to the zip code 00005. By the way, to get this box all I do is I click “add new trigger set.”

If the pizza place delivers to 00005 but they only for whatever reason – I guess it’s hard to deliver a salad – I’m going to say, “We only deliver salads to your zip code. It’s okay. Salad is good for you.” That’s all we’re going to do. We’re going to add the new trigger set for the new zip code and we’re going to have display a custom message if someone types in 00005.

We’re going to leave everything else the same. Click on “save changes.” Let’s go to our zip code search page and refresh. Let’s try a few of those tests again. Let’s type in 12345. No, we don’t deliver there. Let’s type in 00001. They should deliver here, right? “Yes, we deliver.”

But let’s say that we are in 00005. Enter. It says, “We only deliver salads to your zip code. It’s okay. Salad is good for you.” So, that’s how to create a zip code search and of course how to add multiple trigger sets in case certain zip codes only get certain items. Enjoy.