Answers.Body: <p>If you don't want to write a hook then one option is to just update the name in the database so that it sorts to the top, for example:</p>
  
  <p><code>update civicrm_state_province set name='_Washington' where name='Washington';</code></p>
  
  <p>Or equivalently update the states you don't use so they sort to the bottom, like prefix a 'Z_'.</p>
  
  <p>This might get overwritten by an upgrade if there's a change like a state gets annexed by Canada or something ... you're probably safe.</p>
  
  <p>It's also possible some extensions might not work with it, but it's stored as an id not a word and the id doesn't change.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-03-22T19:57:03.103Z
Answers.LastActivityDate: 2019-03-22T20:02:08.010Z
Answers.LastEditDate: 2019-03-22T20:02:08.010Z
Answers.UserDisplayName: Demerit
Body: <p>Civi 5.11, WordPress 5.1.1</p>
  
  <p>I work with an organization whose Contacts (of all types) are limited to 4 states in the US. (Available States/Provinces in the localization settings includes only the US.) In order to speed up data entry for my organization's users, I'd like those 4 states to appear at the top of the States dropdown when new Contacts are added. However I don't see this capability in the Option Groups settings, and I don't see an Order field in the civicrm_state_province table.</p>
  
  <p>Are my only ways forward to create a custom State field, or develop a custom hook?</p>
  
Tags: <custom-fields><addresses><sort-order>
Title: sorting states in state/province dropdown
ThreadText: # sorting states in state/province dropdown
  
  (Asked by: username_0 on 2019-03-22)
  
  Civi 5.11, WordPress 5.1.1
  
  I work with an organization whose Contacts (of all types) are limited to 4 states in the US. (Available States/Provinces in the localization settings includes only the US.) In order to speed up data entry for my organization's users, I'd like those 4 states to appear at the top of the States dropdown when new Contacts are added. However I don't see this capability in the Option Groups settings, and I don't see an Order field in the civicrm\_state\_province table.
  
  Are my only ways forward to create a custom State field, or develop a custom hook?
  
  **Tags:** custom-fields, addresses, sort-order
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2019-03-22. Score: 0 | Accepted answer
  
  If you don't want to write a hook then one option is to just update the name in the database so that it sorts to the top, for example:
  
  `update civicrm_state_province set name='_Washington' where name='Washington';`
  
  Or equivalently update the states you don't use so they sort to the bottom, like prefix a 'Z\_'.
  
  This might get overwritten by an upgrade if there's a change like a state gets annexed by Canada or something ... you're probably safe.
  
  It's also possible some extensions might not work with it, but it's stored as an id not a word and the id doesn't change.
  
  
  ---
  
  