Pioneer Valley Web Design is your local source for Website Design and Development for you or your small business. Services include:

Website Hosting.

Website Management.

Website Maintenance.

Search Engine Optimization.


Printing and Fax Services.
Expert PC Setup, Repair and Maintenance – Drop off Service –  Hardware and/or Software.
Photograph scanning and digital enhancement or repair.

Please Contact Us or call 603-583-3777
M-F 9AM-7PM Sa 10AM-6PM and Su 12PM-6PM.

Pioneer Valley Web Design is located in Montague, MA and has the experience and know how to get your small business or profession online and searchable at a very reasonable rate.

Recent Posts

Use State Abbreviations in your Gravity Forms

First, you will not just need the excellent Gravity Forms Plugin for WordPress, but you will also need a Commercial License to allow the code below to work.

The code is added your Child Theme’s Functions.php file. If you are not using a Child Theme, I suggest you set one up first. Edits to Parent Theme’s are lost on Theme Updates. (That means if you need to update your theme, you will have to redo this work, so a Child Theme is always advised.)

Next, why do we want to do this? My reason is to make passing the Field Value to another application easier. That application wants the State Field to be passed as a two letter standard U.S. State abbreviation (two letters, caps). This is the code:

Note: Made an edit below to the first line after:

"states" => array(

insert on next line:


as this will stop the state of AK from being the default and any Conditional Logic in use based on this field will work as desired. Also allows the Enhanced Interface for this Field.

Below is in use (and includes above edit):

add_filter("gform_address_types", "us_address", 10, 2);
function us_address($address_types, $form_id){
$address_types["us"] = array(
"label" => "United States",
"country" => "USAB",
"zip_label" => "Zip Code",
"state_label" => "State",
"states" => array(
"" => "",
"AL" => "Alabama",
"AK" => "Alaska",
"AZ" => "Arizona",
"AR" => "Arkansas",
"CA" => "California",
"CO" => "Colorado",
"CT" => "Connecticut",
"DE" => "Delaware",
"DC" => "District of Columbia",
"FL" => "Florida",
"GA" => "Georgia",
"GU" => "Guam",
"HI" => "Hawaii",
"ID" => "Idaho",
"IL" => "Illinois",
"IN" => "Indiana",
"IA" => "Iowa",
"KS" => "Kansas",
"KY" => "Kentucky",
"LA" => "Louisiana",
"ME" => "Maine",
"MD" => "Maryland",
"MA" => "Massachusetts",
"MI" => "Michigan",
"MN" => "Minnesota",
"MS" => "Mississippi",
"MO" => "Missouri",
"MT" => "Montana",
"NE" => "Nebraska",
"NV" => "Nevada",
"NH" => "New Hampshire",
"NJ" => "New Jersey",
"NM" => "New Mexico",
"NY" => "New York",
"NC" => "North Carolina",
"ND" => "North Dakota",
"OH" => "Ohio",
"OK" => "Oklahoma",
"OR" => "Oregon",
"PA" => "Pennsylvania",
"PR" => "Puerto Rico",
"RI" => "Rhode Island",
"SC" => "South Carolina",
"SD" => "South Dakota",
"TN" => "Tennessee",
"TX" => "Texas",
"UT" => "Utah",
"VT" => "Vermont",
"VA" => "Virginia",
"WA" => "Washington",
"WV" => "West Virginia",
"WI" => "Wisconsin",
"WY" => "Wyoming"
return $address_types;

Note, this list above includes all 50 States, then US Territories, and last are the U.S.Military ones. (Of course, you can edit the list prior to adding to your site, to remove some or change the order.)

When this is done, you will now see:

Gravity Forms State Abbreviations in Form Editor Settings

Gravity Forms State Abbreviations in Form Editor Settings

Gravity Forms State Abbreviations in Form

Gravity Forms State Abbreviations in Form

Gravity Forms State Abbreviations in Form Editor

Gravity Forms State Abbreviations in Form Editor

Hope this was helpful. Let me know in the comments section.

  1. Zapier and Gravity Forms Leave a reply
  2. Happy Holidays from Pioneer Valley Web Design Leave a reply
  3. NSA Surveillance Breakdown Leave a reply
  4. A Child Category Sub-Menu Leave a reply
  5. How to Set Up Browser Caching with WordPress Leave a reply
  6. Major Update to Google Maps Is Here Leave a reply
  7. Using phpMyAdmin To Get Registered User’s Email Addresses Leave a reply
  8. Chris Hadfield – Space Oddity Leave a reply
  9. Redirect Search Query in WordPress Leave a reply
  10. Using WordPress To Block Comment Spam Leave a reply
  11. A Boy And His Atom Leave a reply
  12. Mars Rover Curiosity 360 Panorama Leave a reply
  13. Windows 8 RTM Leave a reply
  14. Curiosity Lands on Mars Leave a reply
  15. Curiosity Leave a reply
  16. Transit of Venus Leave a reply
  17. Jupiter, Moon, Venus Leave a reply
  18. Keeping Windows Running Cleanly Each Day Leave a reply
  19. Windows 8 Developer Preview Leave a reply
  20. STS-135 and A Farewell Leave a reply
  21. Windows 8 Preview Leave a reply
  22. Discovery’s Final Orbit Leave a reply
  23. The Coveted Service Pack 1 Leave a reply
  24. SPAM 2011 (Same Advise) Leave a reply
  25. Finkbeiner Bubbles Leave a reply
  26. Photo Fuse Leave a reply
  27. Java Exploits Increase – How to Properly Update Java Leave a reply
  28. Prizefight! Leave a reply
  29. The EN-V Project Leave a reply
  30. Windows 7 WMC and DVD Subtitles Leave a reply
  31. Windows 7 – get it now Leave a reply
  32. Windows 7 Enterprise Tests Underway Leave a reply
  33. Outlook Express Grinds to a Halt Leave a reply
  34. Windows Live Tips and Tricks Leave a reply
  35. 10 Great Windows Sites (to grow) Leave a reply
  36. Vista SP2 is here! Leave a reply
  37. XP SP3 Leave a reply
  38. Windows 7 RC Leave a reply
  39. PC Safety Leave a reply
  40. Windows 7 is here! Windows 7 is here! Leave a reply
  41. The Mojave Experiment Leave a reply
  42. Block those Domains Leave a reply
  43. Vista SP1 Streaming Music From Windows Home Server Leave a reply
  44. McAfee Says Leave a reply
  45. A Win, Win with Windows Leave a reply
  46. Half Life II on Vista SP1 Leave a reply
  47. Tech Leaders Leave a reply
  48. Software Inspectors Leave a reply
  49. Reduce SPAM now Leave a reply
  50. National Cyber Alert System Leave a reply
  51. Windows Vista SP1 Leave a reply
  52. SPAM Away! Leave a reply