WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I added a "company" field to member profiles via s2member plugin. However, this field is not included in the "member" search. For instance, when I search on the name of a company (when I know the company name I'm searching for is part of a member's profile info), the search displays "no results".

How do I make added profile fields searchable?

share|improve this question

closed as off-topic by birgire, gmazzap, Johannes Pille, ialocin, Wyck Aug 10 '14 at 13:28

This question appears to be off-topic. The users who voted to close gave this specific reason:

If this question can be reworded to fit the rules in the help center, please edit the question.

up vote 1 down vote accepted

Fields added by S2Member are probably stored in wp_usermeta, while BP's member search searches over data stored in BP's xprofile tables. Probably the most straightforward fix is to use a BP profile field for your 'company' data. If you've already got member data in there, you'd have to write a script that moves (or copies) it over. The alternative is to tap into BP's search queries and join against the usermeta tables.

share|improve this answer
Also - you can make a BP field Required at Dashboard > BuddyPress > Profile Fields > Edit. – Boone Gorges Mar 12 '12 at 22:30
Can make it required, but can't make it part of initial signup, right? In other words, they have to come back and edit their profile before they are required to complete that field? – Ray Gulick Mar 13 '12 at 2:12
The way BP registration works by default, fields from Profile Field Group 1 (which is called 'Base' by default) are shown during registration - whether they're required or not. So the simplest solution would be to make sure that your Company field is in the Base group. It's possible to show multiple profile groups (or a group other than Base) during registration, but it'll take a bit of elbow grease in the registration/register.php template. In the future, it'd be nice if BP let you pass multiple profile_group_id values to bp_has_profile(): buddypress.trac.wordpress.org/ticket/4075 – Boone Gorges Mar 13 '12 at 13:43

If you want BuddyPress to be able to search the profiles, it would be best to use BP's own Extended Profile capabilities to add additional fields to the user profiles. Then you can also install the BP Profile Search plugin to enable fairly rich searching capabilities.

(I've just installed the BP Profile Search plugin myself, and haven't yet figured out how to actually display the search form, but it seems to be pretty configurable, based on the options screen -- click the little gear that shows up in the left-hand dashboard after installing the plugin.)

share|improve this answer
Yes, but I have to balance that against the ability to require the field be completed at signup. I may be missing something, but can't see where I can do that with BP extended profile fields. – Ray Gulick Mar 9 '12 at 4:40

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