Is there a way to automatically create membership numbers for members?

There is the CiviCRM ID but this applies to all contacts, not just members. I'm looking for a way to create a number that only applies to members.

This question was asked a few years ago on the forums (Membership number/code) but I wonder if there have been any developments since then.

  • Why do you want the number only to apply to members? We use the contact ID very successfully as a membership number. One glance at the summary screen for the contact tells you if they are a member or not.
    – JoAnne
    Commented Apr 5, 2016 at 14:18
  • The CiviCRM ID is an option but it isn't ideal for a number of reasons: it doesn't identify the contact as a member (since all contacts have this ID), membership numbers won't be sequential and will increase more rapidly than actual number of members (membership is small compared with the overall number of contacts). Commented Apr 5, 2016 at 14:36

3 Answers 3


Do you want a membership number, or a number for members.

Each membership in civicrm has an Membership ID associated with it (Used for linking fees paid to the memberships) Perhaps you could use that as your member number.

There are two downsides to that:

  • I doubt any member will have more than one membership so I don't think that is an issue, so long as members can keep the same number when they renew. However, staff do need to be able to see the membership number. How do you view the Membership ID? Commented Apr 5, 2016 at 12:23
  • 1
    I have edited answer to explain how you can find it. As I said it isn't readily visible which is why you would need some customisation (which I can't advise on).
    – JoAnne
    Commented Apr 5, 2016 at 14:15
  • Thanks. If staff can't view the Membership ID through the user interface then it isn't really an option. Commented Apr 5, 2016 at 14:30
  • 1
    To display the Member Id is not difficult, you could use hook_civicrm_contact_get_displayname to append the ID to the name in the Contact Summary, see gist and screenshot here: gist.github.com/mecachisenros/785d9d8eef15359b4f66a332406b7b0e Or you can use hook_civicrm_searchColumns to add a new column to the Membership Tab and display it there. As for searching by Member ID, I guess you would have to create a Custom Search.
    – Andrei
    Commented Apr 5, 2016 at 15:51
  • 1
    In drupal you could drop a block in to the sidebar to show the Membership ID if the contact has one but from memory you need a bit of php to pull the cid out of the url and use as the contextual filter in the block
    – petednz - fuzion
    Commented Apr 5, 2016 at 18:40

I'm not sure whether it would be any use to you but there is a CiviCRM Core Extension called "Custom Membership ID" by Grant Traynor which is at the following link Custom Membership ID

  • Yes, I saw that. Have you used it yourself? Commented Apr 6, 2016 at 17:06
  • 1
    Hi William. No I haven't used it myself. When we started to use CiviCRM, we imported an old membership system and retained the old sequential membership numbers in a custom field. At the moment we are updating those numbers manually as and when a new member joins up. It hasn't really been a problem but of course it is extra work. We have thought about just using the Membership ID as the membership number but we haven't got around to it yet.
    – peterb
    Commented Apr 7, 2016 at 20:35

Grants extension "Custom Membership ID" isn't working with up-to-date CiviCRM (5.36).

If you like a view of the Membership ID (and type), please install the extension "Display MemberID" from https://civicrm.org/extensions/show-member-ids It shows the ID in Contact Summary (next to contact ID) and in Memberships.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.