Note: With the introduction of WP-Members 2.6, users can now create new fields and delete exiting ones using the plugin’s admin panel. That feature renders this methodology unnecessary for most users, unless you have a reason to set up custom fields at install.
The single most common question I receive about the WP-Members plugin is how to add custom fields (or change the fields that are installed). Changing the fields that are installed is a very simple process, as you will see.
The fields are stored in the WordPress database in the options table. They are stored as a single array (so that we don’t bulk up the database with multiple entries unnecessarily). This array is written to the database when the plugin is installed. It is recommended that if you are customizing the fields, you begin with a clean install. (That means that if the plugin is already installed, you should not only deactivate it, but delete it via the plugin manager in the WP admin panel. This will clean out any database entries the plugin has made.)
The install script is in the file wp-members-install.php. As with any plugin, the plugin files can be found in the WordPress plugins folder. This is found in:
/your-wordpress-folder/wp-content/plugins/
WP-Members stores all of its files in its own folder in the plugin folder, and that is where you will find the install file:
/your-wordpress-folder/wp-content/plugins/wp-members/wp-members-install.php
As an alternative, if the plugin is already installed on your system, you can use the Plugin Editor in the WordPress admin panel. In the WP Admin Menu, go to:
Plugins > Editor
In the upper right hand corner of the Plugin Editor there is a dropdown menu. Select WP-Members from the list. Then select wp-members/wp-members-install.php from the list of files, make the appropriate changes, then save by clicking “update file.”
In wp-members-install.php, look for $wpmem_fields_options_arr near the top. This is where the array values are defined. Change these accordingly based on the following:
- Order: Not used yet, but will be in the future. This will define at what point in the display order the field will appear. Since this is not used presently, you must keep the fields in the array in the order you want to display them.
- Label: This is what will display in the form next to the field.
- Optionname: This is used by the script to pass values to the script. The important thing to remember here is that you CANNOT use spaces in your definition; i.e. ‘field_name’ NOT ‘field name’. Note: this does not display to the user.
- Input type: Defines the field type. At present, fields must be text. Checkbox is being tested and should be considered experimental.
- Display: This sets the default setting upon install whether this field is displayed or not. y = yes, it is displayed, n = no it is not. Once you install, you can change this value for each field via the plugin’s admin panel.
- Required: Sets whether the field is required or not based on the same principle as above.
- Native: Not really important. The defaults are all set to tell you which fields are natively part of WP and which are not. Any custom fields you create are obviously not, but setting them to ‘y’ is not going to break the script.
You should find this fairly intuitive, just basically copy the process as it is already in the installation.
If you have already installed and activated the plugin on your system, you will also need to force the new field array into the database. This is done with a toggle at the top of the install file:
$chk_force = false;
Change this to:
$chk_force = true;
Then save the file and using the plugin admin panels, deactivate then reactivate the plugin. This will force your changes into the database. Following this procedure, it is recommended that you change the toggle back to “false” and also check your WP-Members settings for anything you may have set back to the default options through this process.
Some important notes:
While I do not think this process is that difficult, you should use these steps at your own peril – especially if you are clueless when it comes to php. If you choose to customize your installation and break it, please do not come to me and ask me how to fix it.
Also, it is highly recommended that you not change any of the WordPress native fields. Without getting into too much necessary detail, most of these are stored a certain way and the plugin makes assumptions based on names and locations in the database for these. It doesn’t mean you have to use them, and certain ones are non-essential, but do not change their optionname.

Hi Chad,
Thank you for this plugin, this really helps. I have one quick question. I want a dropdown field in my registration form, so I uncomment the lines about how to add dropdown in wp-members-install.php but it doesn’t show in the backend. Can you help me with this? Did I miss something?
Thanks,
Ivy
So the question would be, is it showing on the front end? If it’s not showing on the front end or the back end, then it didn’t install correctly. If the plugin had been previously installed, you also need to follow the instructions above to force an install.
Hi Ivy,
Have you find the solution for the dropdown field? If you do, could you please tell me how you find it out.
Hi,
I’m very excited to try this plugin! Wondering if it’s possible to add a custom field where someone has to enter an invitation code in order to register.
In other words, I don’t want just anyone to be able register. This is a doctor only site and registration is by invite only… is there a way to have registrants enter a code that is given via email during the registration process? The “Membership” WP Plugin has this functionality… wondering if wp-Members does also…
If not, can I use the Sabre plugin or some similar plugin in tandem with wp-Members to protect site registration?
Thank you in advance for your time!
~ Angela
Hi Angela – thanks for the comments. There is no allowance for an invitation code at this time, but that is a good idea that I’ll need to add to the project list. Unfortunately, I’m not familiar with the Sabre plugin so I can’t really give you any insight into integration (although the WP-Members registration process is self contained so without directly modifying the code, I don’t think that it will).
Hi Chad,
Thanks for your reply. The Sabre plugin didn’t work out the way I had hoped. It didn’t integrate smoothly with your WP-Members plugin. Unfortunately, registration by invite only (needing a special code to prevent just anyone from registering at the site) is critical for the site I’m building… I couldn’t find any plugins or combination of plugins that offered exactly what I needed and many didn’t even work! So I ended up scrapping WordPress and going with Drupal.
If you ever do decide to offer an invitation code option as part of your plugin, please do let me know! I like everything else about the plugin you have to offer! It was just missing that invite code. =)
Thanks again!
~ Angela
Hi,
How can we change the password so that it is not auto generated, but it set up by the user in the form?
Any Ideas?
Ash
After a successful registration, a user can login and set their password to whatever they want. The purpose for autogeneration is for validation – the registrant must provide at minimum a valid email.
It could be changed from this process, but you need to make several modifications to the core which is not recommended.
When i click on register it doesnt take me anywhere. It’s like if the registration link is dead. What am i doing wrong? Please help.
You haven’t really provided any information that would allow me to give you an answer. Where on the page is the link that you are referring to (is it part of the plugin)? What is the text of the link? What is the URL the link is pointing to? Have you set a registration page in the plugin settings? Has that page actually been created/setup? Do you have a link to an example of what you are describing?
Hi Chad,
I am new to this so I apologize for sounding like a noob.
The website is thermgl.com
I created a page for registration and under the wp-settings i where “register page url:” i put http://thermgl.com/registration.
what do you mean what is the text link?
Please help.
Thanks in advance!
Victor – it’s no problem sounding like a noob, but regardless of whether it’s WordPress or anything else, when asking for support, the more information you can provide at the outset, the better. It makes it much easier to give you some direction.
I can see that you have set up a registration page. I can also see that you have this correct in the settings because when I look at the WP-Members sidebar widget on your home page and click “register,” it goes to the correct page. So that ultimately brings us back to the question what is the text of the link you are clicking that you are saying doesn’t take you anywhere. And what is the location that link is supposed to be directing you to (shown to you in the footer of your browser when you mouse over a link)? If it’s the forum that you are talking about, then you need to track that down in the forum. The only registration links that WP-Members puts in automatically are in the login forms that it generates and that link information comes from the setting we already mentioned that you have correct. Anything else would be outside of the plugin.
Chad,
i stayed up late last night reading your quick guide and figured out how to correctly install the plugin and create the page.
The text link i was referring to was the “register” link. Now when i click on register it does take me to the register page but nothing is lined up and it looks horrible.
Is there anyway to adjust the columns and make it look nice and clean?
Thanks in advance!
Hi Victor – I’m not sure how familiar you are with CSS, but that’s basically a styling issue. There may be some inherited elements from other stylesheets that you’ll need to define and create a custom stylesheet for the plugin. http://butlerblog.com/2011/07/25/customize-the-wp-members-stylesheet/ will get you started with how to set up a custom stylesheet for the plugin. As to how to customize it, because that can vary from user to user depending on your theme and other plugins, you will need to work on that.
If that turns out to be too much of a challenge (depending on your familiarity with CSS), then you might just try changing to use the table-based legacy forms in the plugin’s settings. These are less customizable, but will generally work well in most situations.
I want to change the dialog message when a user tries to login with the incorrect username or password. I thought I had found it in the wp-members-dialogs.php file under “function wpmem_inc_loginfailed()” but when I changed, saved and uploaded there was no change to the message. I also changed the height of the dialog box thinking maybe it didn’t have room to display but that didn’t fix it either. This is a site that members already had registered but now need to establish new usernames & passwords. I want to add a message that they will need to re-register on the new site. Thanks for any help you can give me.
The majority of the dialog messages are editable in the plugin’s admin panel. If you want the message to display where the login/registration goes, update the dialog for restricted posts (the first in the list) accordingly. I would highly advise against making changes directly to any of the core files.
Hi Chad,
first of all, your plugin saves me alot of sweat! it’s a really nice plugin. But i want to make a group of checkboxes, i already select the ‘checkbox’ type and insert the value, but how do i add the label for it?
Say i want to make a group of ‘hobbies’, how do i make them like: ‘checkbox’ – sports, ‘checkbox’ – games, bla bla bla
thanks for the enlightment Chad!
Thanks for the comments. If they are checkboxes (there is not currently radio group support), then the best way to do it would be with CSS styling. Each form element gets an ID. Handling the layout with CSS would be the best way. Here is some insight on setting up a custom stylesheet to start.
The other possibility would be to create your own form. If you are handy with PHP and/or HTML, you could plug the function wpmem_inc_registration_NEW (information on WP-Members pluggable functions here). Note that if you set your form elements and don’t plan on changing them, you could hard code most of the form into this function rather than using the php loop, etc. However, note that there are probably going to be some changes in this area of the plugin in the near future (2.7 won’t touch it, but possibly later) and even though pluggable functions help keep you from having to re-do such hacks, you do need to monitor the customized functions when new versions come out to make sure customizations are still compatible.
Hi, great plugin, better than ones I paid a lot for.
I’m wondering how I can change the titles of the login and registration boxes from Userlogin/New user registration to something custom. Thanks.
There is a pluggable functions process for customizing various functions. The function that generates the forms are in wp-members-dialogs.php and are pluggable.
Great, I found it, thanks a lot Chad.
Hi Chad,
Thank you for the plugin, it works great.
People ask me if I can change the labels to Dutch (Voornaam First Name)
Is this possible without reinstalling?
Kind regards,
Rob
Hi Rob – you won’t have to do a full reinstall, but you will need to force some translations into the database (described here: http://butlerblog.com/2011/07/13/forcing-translated-field-names-when-using-translation-files-with-wp-members/). This process will overwrite any existing settings you have for the plugin so if you have changed anything from the defaults, you’ll need to update those afterwards. Note: this process only effects the settings (options, fields, dialogs, emails), but it doesn’t effect anything outside of what is in the plugin’s options panel, such as users and content data.
Thank you very much, it worked!
Hi there! thank you so much for this wonderful plugin. Please help me with my problem regarding adding members. My client want me to add their existing 11 thousand members to wp-members database with information. How can i add BULK members in wp-members database with their corresponding information like age, gender, birthday etc. Is there a way i can add it as csv file to database or any recommended plugin. Please kindly help me.
With a list that large, I would highly recommend a direct import via MySQL. You need to be familiar with the WordPress database structure (specifically the wp_users and wp_usermeta tables, http://codex.wordpress.org/Database_Description). You’ll need to know how to do SQL joins for the meta data. Also, you should be aware that you could run into challenges with passwords. WP stores passwords as PHPass hashed. If an MD5 hash is imported, that’ll work too, as WP will simply change it to PHPass when the user first logs in.
Hi,
I have been trying to use this plugin and this is a great plugin for blocking posts . I have a simple (maybe stupid) question. In my blog, are new users are created by me (upon user’s request email). I create a new user, but then I go back to his profile (to fill out his other details), but I see some fields under “WP-Members Additional Fields” . I don’t worry about TOS field, but what is the purpose of the field ” Activate this user?” ? Also, if I check this field, it sends out an email automatically to the user. How can I stop this email? Please let me know. Thank you for the great plugin.
The activate user process is for if you want registrations to be approved by you. If you are handling registrations yourself, then you don’t need that. Just turn off registration (in the plugin options) and don’t set up a registration page.