How to Use Wordpress as a Membership Directory

This article was written by Chris Cagle.
Do you want to create a moderated membership directory that showcases your member’s information? Do you want it to be flexible, be very little work after initial setup, and use a world-class open source platform that you are already familiar with?
Your first thought might not be to use Wordpress for such a project, but since it already has an extremely easy way to accept, moderate and update registrations – it’s a perfect candidate.
In this tutorial I will show you how I built a successful membership directory using nothing more than a standard Wordpress 2.3+ install and 2 very powerful plugins.
The Plugin Installs
The heart of the site is powered by two plugins.
First, use the WP User Manager plugin from Dealsway to add new fields to the user profiles. The install and setup is pretty straight forward - just activate the plugin and add any new fields you want via it’s own admin section. The information entered in these fields will become the information that will create the member’s “homepage.”
Secondly, we use the famous Role Manager plugin which restricts what your members can do once they are logged into your site. This is important because in order for a member to be granted their own author page, he or she needs to have made at least one post.
In my case, I didn’t want my members to have the ability to post anything, just to only fill out their profile information. To get around this, I used the Role Manager plugin as-is, but changed the Author role to only have the rights Publish Posts and Read. (The Hide Dashboard capability you see in the screen shot is a function of the IWG Hide Dashboard plugin. It was an easy way to clean up the admin panel for my members.)

Setting Wordpress Options
After you have installed all the plugins, we need to get Wordpress ready for your new registrations.
In your Admin panel, under options, set your New User Default Role to Subscriber. This ensures that a member won’t be given an author page until you “approve” and manually move them to the Author role. (A Subscriber can’t make posts, an Author can.)

Once a member has registered and filled out all the appropriate profile information, we need to “approve” that member. We do this by simply moving that member into the Author role and making a post on his or her behalf. I want each approved member to have made a post in order to create the New Member Feed [example]. To post on behalf of that member, choose that member’s name out of the dropdown list in the Post Author section in the sidebar before publishing their post.

This post doesn’t need to be anything spectacular. On Pittsburgh Designers, I simply write “This business has been added as a member. Please visit their Design Profile.”
There are other ways of doing this to make it slightly simpler, but I do it this way because I want to use Wordpress’s default feed as a New Member Feed.
Your membership management duties are now done.
Creating the Author Page
All that’s left now is the need to create the author.php template to display all this new member profile information that the WP User Manager plugin allowed us to accept.
For the sake of this tutorial, we only added 2 new fields to the member profile page: business_name and business_owner.
At the top of the author.php template we will add this code. Hint: Each new field you add will need to be declared here.
/*
Template Name: Author Template
*/
$curauth = $wp_query->get_queried_object();
$business_name = get_usermeta($curauth->ID, $key);
$business_owner = get_usermeta($curauth->ID, $key);
Now right below that, in the body section of your template, we are going to add this data and markup to display it in a structured way:
<div id="bodycontent" >
<div class="bodytext" >
<h2><?php echo $business_name; ?></h2>
<p>The owner of this business is <?php echo $business_owner; ?></p>
</div>
</div>
<?php get_sidebar(); ?>
<?php get_footer(); ?>
The next step is to also show some of the default fields that the member entered within their profile. I only want to show the member’s website address and About the user section, so we modify our template to look like this:
<div id="bodycontent" >
<div class="bodytext" >
<h2><?php echo $business_name; ?></h2>
<p>The owner of this business is <?php echo $business_owner; ?></p>
<p>Website: <a href="<?php echo $curauth->user_url; ?>"><?php echo $curauth->user_url;
?></a></p>
<p>About the Business: <?php echo $curauth->description; ?></p>
</div>
</div>
<?php get_sidebar(); ?>
<?php get_footer(); ?>
Hint: A full list of $curauth-> calls can be viewed in the Wordpress Codex.
Lastly, we want to do some basic error checking.
What would happen if the member didn’t put anything in the business_owner field? In this case, we can just wrap that line in an if statement (…or any variable we want to protect against being blank):
".$business_owner."</p>"; }; ?>
Listing your Members
So how do you list all of your approved members? It is as simple as adding the wp_list_authors to any template file. This is the customized version of that function I use:
?>
Tutorial Wrapup
This tutorial was based on my experiences in building the Pittsburgh Designers community into a thriving, local membership directory for creative types. Mosey on over to the site and take a peek for yourself how what a finished project like this can look like.
You can download the complete finished author.php template here.
About the Author
Chris Cagle is a freelance web designer from Pittsburgh, PA, whose projects include Pittsburgh Designers and AdClustr.


Really nice! Gonna try it. I have all the plugins you name there. But really didn’t know all the things i can do with them
thanks.
Keep on Wordpressing.
[…] Wordpress. Go ahead, subscribe to our feed! You can also receive updates from this blog via email.Wordpress as a Membership Directory: After the recent tutorial on setting up WordPress as a Contact Manager, Chris Cagle has written up […]
interesting. i dont really have any use for something like this, but i’ll give it a shot anyway just so i can say i did it. LOL
Hi,
Do you allow me to translate this post to my language, mantaining the credits at the end of the post?
Thanks,
Rui
@Rui - The link to your blog has been removed because it displays adult ads.
very nice, thank you
Cool! I just setup wp-contact manager as a theme for my green blog directory, but this is nice, because I wouldn’t have to do all the cut and pasting I do now when someone submits a blog.. Oh, well, back to the drawing board =)
What do you think about using wordpress as a invoice manager? Each post could be an invoice that prints to pdf. possibly have it mail the pdf directly to clients. i’ve been toying around with the idea, but im not a savy enough programmer. i realize it would require modifying the WP core.
[…] Read the full article here Insights, Recommended Wordpress Plugins, Tips, Wordpress […]
What about using WP as a a document server? Each document should be a post with categories, tags and rating. It should be feasible without too much hassle. Wp-contact manager is cool !!!
@Dem, Jenny & Timothy - I’m very glad you find the article useful. I have had a lot of success with this membership site and hope that it works out just as well for you…
PS - Thanks to SP for letting me guest post - it was an honor!
Thanks so much for the article. It is really great to see how WordPress can be used for some many purposes yet in a very simple way without much hacking.
Great tutorial, it actually gave me an idea! Will try it soon.
v1ktor
Excellent post Chris, and well-written tutorial.
It’s given me serendipitous inspiration to apply this to a community I was just about ready to launch. Not to mention another one I can create now that you’ve provided this excellent insight.
Again, thanks to you, and to SP for his environment here.
Michael
[…] How to Use Wordpress as a Membership Directory (tags: wordpress) […]
nice tutorial!
[…] WPDesigner » How to Use Wordpress as a Membership Directory (tags: wordpress membership plugin) […]
Thanks so much for sharing this.
I’d been scratching my head over implementing something like this in recent months for a small club and now you’ve made it look so easy
Thanks again.
[…] 1 - WPDesigner » How to Use Wordpress as a Membership Directory […]
good stuff, waiting on the “how to create your own job board for wordpress”
[…] about WordPress being used for contact management, this week we have Chris Cagle’s “How to Use Wordpress as a Membership Directory“, “TDO Forum Wordpress Theme“which I read about in Scott Gilbertson’s […]
[…] WordPress as a Membership Directory: After the recent tutorial on setting up WordPress as a Contact Manager, Chris Cagle has written up a tutorial on WP Designer on how to use WordPress as a Membership Directory. He has setup a Membership Directory for Pittsburgh Designers and uses his experience from that project to outline the steps, plugins and code required to set this up for yourself. Beside the annoying CSS bug that puts a text box in the middle of every page, the setup looks nice, highly versatile and very useful for both designers (in this case) and future clients. I really like the Members Directory and the ability to display detailed contact information and portfolio of every designer. Even the signup is automated (and modified to suit the need) and relatively painless. I am curious to know what they plan to do about possible spammers posing as designers, but thats another story. […]
[…] into a successful membership directory over at PghDesigners.com. A few days later I published How to Use Wordpress as a Membership Directory. It was an instant success and has since been mentioned by some of the big guys that help power […]
Get’em Chris!
Imo, this represents the very best of what’s possible when we (WordPress Community et al) provide a platform to the masses that can be used equally well by designers and developers.
Thank you for taking the time to explain how to use the code in a way designers can use it. I think the reward will be some really usable and good-looking sites using the functionality you present -much like the directory you created. Way 2 Go!
@Delusional, Michael, Viktor, Matrich, Justin & anyone else I may have missed - thanks!
@Brent - Thank you very much!! It was a joy creating the community as well as a great feeling knowing that what I wrote here may help others in some small way.
I really hope that people come back to this post to show off some of their own creations started with this code…
[…] How to Use Wordpress as a Membership Directory. […]
[…] Turn WordPress into a Membership Directory - Chris Cagle wrote a guest blog post on WP Designer which explains how to build a membership directory within WordPress using the default WordPress 2.3 install with two plugins. […]
This is really cool.
I have an idea for a directory site for the open source ecommerce plaftorm magento.
What’s has stopped me for doing it is trying to figure out how.
Now I’ll actually do it! Thanks.
Anyone figure out a way to integrate this with cforms? I noticed the latest version of cforms is compatible with role manager…
[…] you know How to Use Wordpress as a Membership Directory? Great […]
[…] How to Use Wordpress as a Membership Directory (Source: WP […]
SP and Chris. I’ve recently installed MU on one of my sites just to practice with it. Have you tried WordpressMU? Maybe we can do things better with it. Where every author or user have his own sub.domain and maybe it will be more simple to implement a member directory. In fact, every member will have his own theme, and several other things.
I know, it’s more complicated. But, it will be nice to start practicing with it.
i see how to list current members - but what if I wanted to list the business names instead?
Awesome tutorial…. btw.
[…] How to use Wordpress as a Membership directory […]
This looks great. I am wondering if you know of any way to include a photo on the member list page? I built this page, but I have to update it by hand every time we add a new author.
[…] Comment utilier WordPress comme un annuaire. […]
Hi, do you know if there is any way to list the authors by a given category?
Example: imagine a website of an orchestra that must list all the players with personal datas, can they be listed by category (trumpeters, violinists etc)?
[…] WPDesigner » How to Use Wordpress as a Membership Directory (tags: wordpress membership tutorial plugin) […]
[…] a great post from WPDesigner on using WP as a membership directory. It’s a fairly easy step by step guide to the process, which also outlines the plugins you […]
Chris
I was with you until the Author page instructions. I’ve added some new fields, edited your author template file to suit my own needs, but what do I do with that file now?
Great idea and tutorial…
Thx
[…] Did you know How to Use Wordpress as a Membership Directory? […]
[…] ran across this blog post at WPdesigner.com on using the WordPress blog software to run a membership […]
@Evan - I ended up hacking the profile.php file to change the “Display name publicly as:” field to only offer the choice of the business name field.
@Dalton - I think there is a plugin for this, and I believe that WPDesigner uses UserPhoto
@cicciosax - I haven’t found a way yet - but if you find one, let me know. It could be really useful.
@Scot - Sorry for any confusion there… You add that template file to your themes directory within your WP installation. From then on, when you click on an author link, WP knows to use that author.php file because of it’s hierarchy.
Everyone else - are there any working versions of this out there yet? I would love to see them!
[…] Wpdesigner.com How to Use Wordpress as a Membership Directory […]
[…] How to Use Wordpress as a Membership Directory (Source: WP […]
[…] For the advanced, here is a great guide on how to use WP CMS for a membership directory. […]
[…] recently published an article over at WPDesigner that gave detailed instructions on how to create a Wordpress backed membership community. A working […]
[…] Did you know How to Use Wordpress as a Membership Directory? […]
Your website is a great
thanks
[…] How to Use Wordpress as a Membership Directory […]
but this tutorial work on wp 2.5?? because i have some problem, i can’t show the author list in sidebar and the author page not work .
Please help
Bye thanks
@Stew - When this was written, 2.5 wasn’t out yet, and I haven’t tried upgrading PghDesigners.com yet.
What errors are you getting? What shows on the author page? Did this ever work in a 2.3.3 install for you?
i not try it for the 2.3.3 only for the 2.5 version, maybe i make an error in installation.
but i have a question, i must make with my web site a section with the list of the company partner, that show the contact, name, business, name , web site and other, and more important show the logo of it.
I can do it with this tutorial? Can you help me to do it?
Bye
this is the error when i insert the string
in sidebar:
Parse error: syntax error, unexpected ‘=’ in /web/htdocs/www.my-webmagazine.com/home/wp-content/themes/default/sidebar.php on line 62
This looks great – thanks so much for posting it! Unfortunately, I wasn’t able to get it going, due to my limited knowledge in this area.
Would anyone be interested in getting this working for me for a small fee?
–Briggsy
If its possible i want to translate the article to duch, remaining the credits, please let me know.
Hi Chris,
Thank you for a great tutorial.
This give me the possibility to build something similar for a local community. Only I am looking at 800 or more members. Is there an way that members can be ordered alfabetically and divided in to several pages ? So a page for A, one for B etc…
I understand the basic in Wordpress but haven’t found a solution yet. Is this possible and how.
Thanks again.
Hello
i understand how work with this tutorial, but i must insert logo for the avery autors, how do it?
Hello thanks
In the Pittsburgh Designers i see the image of author, can i show it?
Thanks for the nice tutorial
Could this be used to keep track of a customer database as well? Thanks for re-posting this article, this is a very cool use of Wordpress -
Please can reply to this:
In the Pittsburgh Designers i see the image of author, can i show it?
Thanks for the nice tutorial
Thanks Cris
Ok i have resolved
thanks
Chris
This information is great - thanks very much!
I do have a problem though relating to author.php …for now I’m just hard coding a link from a post to mydomain/author/johnc and instead of seeing a page with the business name/owner fields I’m getting
Parse error: syntax error, unexpected ‘<’ in mydomain/wp-content/themes/default/author.php on line 15
Can’t see where I’m going wrong? (Using on wp 2.5 by the way)
More generally does anyone have any suggestions on how to include provision for paid-for memberships?
Can’ t wait to get this working!
re comment 63
Copied the example author.php from the codex examples and got that working.
So, any thoughts on how to manage paid memberships?
JohnC
[…] WPDesigner » How to Use Wordpress as a Membership Directory […]
This is awesome, I’ve got it almost setup but I’m wondering if anyone knows how to go about linking the author who makes a comment on a post (who’s role is “author” but doesn’t post on the main blog) linking to the author profile page?
I’ve got my Author’s who blog on the site linked to the author page with their profile, but I want the commenters who are authors to have a link to their profile page too.
I tried but it just displays the name of the post author in everyone’s comments. I looked in the codex, I’m sure there’s a way of doing this.
Thanks,
shane
@Shane - can I see the example site? If you want to send me the site URL - my email address is on my site.
I think i have an idea of what you are talking about, but I am not sure until I really see what is happening…
DUE TO THE IMMINENT DEMISE OF WPDESIGNER, I AM MOVING THIS GUEST POST OF MINE TO MY OWN SITE:
http://www.cagintranet.com/archive/wp-membership-directory
I will not be checking wpdesigner for any other questions or updates. ALL further correspondence on this article should be moved to the URL above.
Thank you!
[…] WPDesigner » How to Use Wordpress as a Membership Directory […]
[…] To Your WordPress Blog. 120. Make a Mobile Friendly Version of your Blog with Google Reader.121. How to Use Wordpress as a Membership Directory. 122. How to Format Images for Feed Readers. 123. Add Del.icio.us Daily Blog Posting To Your […]
SELECT fieldlist
FROM customers
WHERE name = ‘\”; DROP TABLE users; –’;
Nice tutorial, Chris. Yep, it looks like WP is heading downhill fast.
Hi Guys,
we are running an “Article Writing Contest”
$600 worth prizes to give away.
Please check the link below to participate in the contest …
http://blogs.qualitybusinesslinks.com/
Just 1 article and you can win $$$
We hope to see your article entries soon ..
Good Luck.
-Andy