Skip to main content

Questions tagged [user-meta]

User meta data consists of key-value pairs pertaining to the according user ID.

Filter by
Sorted by
Tagged with
0 votes
1 answer
4k views

Is there a limit to the length/size of serialized data that can be stored as user meta?

I tried to store an array containing about 50000 keys and respective values to the user meta using update_user_meta. Since, this was only a test, I ran a for loop to generate the array. $test = array ...
John's user avatar
  • 1,449
24 votes
4 answers
18k views

How to create a front end user profile with a friendly permalink

I want to create a public front-end profile page with a friendly url like this format. mysite.com/user/someusername Any idea on how can i achieve this? I know it has something to do with rewrite ...
tiltdown's user avatar
  • 444
5 votes
5 answers
15k views

Problem storing arrays with update_user_meta

I am writing a function that adds an ID number to an array and puts the array in the usermeta. $_GET['auction'] is the post_id. Below is the function: $reminders = get_user_meta( $current_user->...
Jarred's user avatar
  • 498
4 votes
1 answer
11k views

Update user meta using with ajax

I want to edit user meta on the front using an ajax form, this is what i have: The form has the user ID: <form id="<?php echo $current_user->ID; ?>"... This is the script:: <script&...
Al Rosado's user avatar
3 votes
2 answers
2k views

How to use hyperdb to separate and share a user dataset between wordpress installs?

I'm looking for a way to separate my users and usermeta table to be in a different database than my main WP install. The end goal is sharing these table over a number of WP installs. From what I read,...
Crazycoolcam's user avatar
3 votes
2 answers
3k views

Ordering users of a specific role by last name

I'm trying to display a list of authors by their last name. I can get the list to display but as yet I don't seem to be able to order the list by last name. Any help would be greatly appreciated. Josh ...
Josh's user avatar
  • 59
2 votes
1 answer
2k views

Adding Custom User Profile data based upon Categories

Based upon the code found here: How To Add Custom Form Fields To The User Profile Page? How Could I alter this so that users could check one of several boxes based upon categories I have setup in the ...
Houghster's user avatar
16 votes
9 answers
37k views

Adding fields to the "Add New User" screen in the dashboard

I'd like to add the field "Company Name" to the add new user page in the admin panel. I've done quite a bit of searching and have been unable to find details on how to do this. I can easily add info ...
Zach Shallbetter's user avatar
13 votes
2 answers
27k views

add_user_meta() vs update_user_meta()

I'm looking at the docs for add_user_meta() vs update_user_meta(). If the current meta_key does not exist for a user, will update_user_meta() automatically add the meta_key for that user or do you ...
Tim Plummer's user avatar
4 votes
1 answer
8k views

Getting all user metadata from user

I am trying to show bio and other custom metadata for my users in a page. So, i want to query the user metadata table for it. I have tried but did not find any functions for that. What i am looking ...
Sisir's user avatar
  • 7,772
3 votes
2 answers
14k views

Show User Their Password

I've got a few automated scripts that run to notify users of certain updates to the application, etc... and for one in particular, I need to be able to display the users user_login and their password. ...
dcolumbus's user avatar
  • 637
2 votes
1 answer
375 views

Querying Email Addresses for a List of Users with Same Last Name?

I have a site with many users and many of them have the same last name. I want to get the emails of all the users with the same last name (IE: Smith) that has a post related to a particular taxonomy ...
Holidaymaine's user avatar
1 vote
1 answer
3k views

Display sortable User meta column in admin panel user's page

I have defined login levels for users registered on my site as Level 1 and Level 2. I have added a column for same in admin panel users page (users.php), I'm trying to add sorting option but on click ...
Akshat's user avatar
  • 1,197
1 vote
2 answers
15k views

Calling a method from functions.php on a click of a button

I have been working on a project where I will have to call a method(that accepts user id as an input) from a click of a submit button(Accept button). I have been trying all the ways but the real ...
Subham's user avatar
  • 27
1 vote
0 answers
2k views

SQL query equivalent to WP User Query

I have the following WP user query code: //Get all users sorted by whatever $sorted_users = new WP_User_Query(array( 'orderby' => 'meta_value', 'meta_key' => 'satisfaction_rating', '...
Thought Space Designs's user avatar
1 vote
1 answer
121 views

User profile custom field

Good day, I've added the following code to my theme's functions.php file, which should display a custom field on the user profile screens: add_action( 'show_user_profile', 'display_user_custom_hash' )...
user avatar
0 votes
1 answer
3k views

Updating User Meta with SQL Query

I have a Wordpress site that needed to have 9,000+ users imported to set up a Directory Listing. I imported them from an existing MySQL (non-wordpress) database and everything imported just fine. ...
the gearbox's user avatar
0 votes
2 answers
17k views

Create Unique ID for user

I have to create a membership site, but I need to give every user that registers a automatic ID number. For example, User 2 - has a code - pay-102 User 3 - has a code - pay-103 I did a forum ...
Andy's user avatar
  • 139
0 votes
2 answers
7k views

Plugin that would allow WordPress Authors to "follow" other Authors and query "Activity Info" from that

I have a WordPress blog that is all user based Authors that submit content and such. Currently in the site, you can view other authors profiles but basically just view their content from the author....
Zach Reed's user avatar
  • 173
19 votes
3 answers
36k views

How to get a buddypress user profile link and a certain user profile field for the current post author?

I want to replace get_author_link() and get_the_author_meta($feld) with something equivalent to point to the author of the current post Buddypress user profile page and retrieve a specific profile ...
unfulvio's user avatar
  • 1,814
10 votes
2 answers
27k views

How do you update user_email on the front end in WP 3.3?

I am using the following code and everything in the user profile is updating except the user's email. In the template: global $current_user, $wp_roles; get_currentuserinfo(); /* Load the ...
Carson's user avatar
  • 2,345
10 votes
3 answers
20k views

Check if user is admin by user ID

Any ideas how to check if user (by user ID) is administrator? I don't mean currently logged in user.
jmeinlschmidt's user avatar
9 votes
2 answers
9k views

How to make a custom column on the Users admin screen sortable?

I am in the process of adding an additional column to the Users admin screen to display the company for each user. I have been successful in getting this column to show in the table, but I am really ...
Jordan Rogers's user avatar
6 votes
2 answers
3k views

get_user_meta() to Return User Meta Only for Current Blog in Multi Site

I've written a plugin that allows users to bookmark their favorite posts, but have run into a small problem when using it on a multisite network. Each time a post is bookmarked, the ID of that post ...
Pippin's user avatar
  • 4,886
5 votes
2 answers
292 views

Content hooks vs User hooks

This is more of a theory question than a question with a direct answer. I've been working with different actions for firing functions when a post is updated or deleted and when users are updated or ...
MikeNGarrett's user avatar
  • 2,661
5 votes
3 answers
7k views

wp_get_current_user always returns 0

I'm new to wordpress and modifying the code that's already working on a website. I want to get user's ID but I haven't figured out yet how. The following sample code works on my local environment but ...
IsaacS's user avatar
  • 155
4 votes
5 answers
44k views

How to use the WP REST API for new user registration (sign up form)?

Is it possible to create a sign up form that can work through WP REST API for visitors to be able to create accounts on my site? I can create such a form and use it to create new users. This works ...
William78's user avatar
3 votes
1 answer
2k views

Show Biographical Info while creating new user

Is it possible to show the Biographical Info textfield while creating a new user? I know it's possible to add user bio by editing a user AFTER it has been created. But I would like to do this while ...
Jules's user avatar
  • 1,158
3 votes
1 answer
11k views

WP_User_Query with combined meta query - not working?

I'm trying to use WP_User_Query class to list all users basing on their specific meta fields. When I use simple single-meta query, it works fine: $q = new WP_User_Query( array( 'role' => ...
Gacek's user avatar
  • 187
3 votes
3 answers
5k views

LEFT JOIN, INNER OUTER JOIN, LEFT OUTER JOIN is driving me crazy. Please help?

fellow coders! I an having a hard time JOIN(ing) tables. I have a a lot of users on my site and many of them have the same last names. I am trying to get their emails by their last name. WP stores ...
Holidaymaine's user avatar
3 votes
1 answer
5k views

How to get user-meta from Social Login registered users?

It looks like social login plugins (such as Wordpress Social Login, OneAll etc.) do not create users in the original wp-database as regular registration from Admin dashboard. Hence it is not possible ...
tobe's user avatar
  • 119
3 votes
1 answer
541 views

How to create virtual pages with information from user meta profile fields?

Dave Jesch on his site presents a way to create virtual pages in WordPress. Dave created a class "to do all the heavy lifting", as he says. I think, for my purposes this class not require changes, so ...
Yuri's user avatar
  • 1,121
3 votes
1 answer
1k views

User meta to post

I created a field (not acf) in the user profile. The field is called “genere”, and I have another field in the post created with ACF called the same "genere", but it is invoked in my function by the $...
Andrea A's user avatar
2 votes
2 answers
250 views

SQL to check how many sites a user is a member of

I have a multisite installation and I'm working on creating a reporting plugin. One of the things that I would like to do is show the number of sites a user is a member of. Right now, I'm using ...
John Reid's user avatar
  • 161
2 votes
2 answers
1k views

How to get custom user meta by id in custom Gutenberg block

As the title says, I just need to get user meta by the user ID in a custom Gutenberg block (editor side). Essentially what this would return in PHP: get_user_meta( $user_id, 'meta_key', true ); is the ...
Shoelaced's user avatar
  • 369
2 votes
2 answers
2k views

Authors details such as social media links, emails etc → Is this Meta or something else?

The author section of my first WordPress theme is currently hard coded in HTML. See the live website here. This One. These social media Icons and the link associated with them are not provided in ...
WordCent's user avatar
  • 1,877
2 votes
1 answer
5k views

Show a list of recently viewed posts to a user

I have a lot of video posts on my site and I'm looking to show the user a list of posts they've recently viewed. I'm guessing the best route is to just add the post id to an array in their usermeta ...
Pollux Khafra's user avatar
2 votes
1 answer
3k views

Creating a custom post type upon registration

I'm struggling to find the best/quick easy solution to this problem: I have a plugin that creates companies but stores all of the company info as a user so all information is in the user's profile. ...
tjej2016's user avatar
2 votes
1 answer
2k views

How to create user personal pages with information from their meta profile fields?

I asked here how to create virtual pages with information from the user meta profile fields using an external class. I got a good answer and also I have implemented it successfully (thanks to @g-m!). ...
Yuri's user avatar
  • 1,121
2 votes
1 answer
6k views

Extra User Profile Field Upload File / Image

I have been following the following tutorial to try and an upload form to the user profiles. http://www.scribd.com/doc/81666407/Add-and-Remove-WordPress-User-Profile-Fields-and-Display-Them-Within-...
Storm3y's user avatar
  • 53
2 votes
1 answer
6k views

How to update serialized data in the user meta data

In my wp_usermeta table I have a field called "wp_s2member_custom_fields" In it is stored this value: a:2:{s:6:"alumni";s:3:"Yes";s:19:"donations_collected";s:2:"10";} I am trying to use: ...
user608329's user avatar
2 votes
2 answers
1k views

What's the most efficient database method to add and query usermeta?

What's the most efficient way - concerning the database - to add and query extra usermeta fields to a profile? I need to add four additional fields of numeric and text data to a user profile and then ...
markratledge's user avatar
  • 8,735
2 votes
1 answer
2k views

Add profile field (usermeta) to Add New User

Edit: Add profile field (usermeta) to user registration I am trying to add a custom field to the Add New User page much as I have done with the user profile page like so: add_action( '...
mantis's user avatar
  • 790
1 vote
1 answer
3k views

Are the default entries for a user in wp_usermeta documented?

On a fresh vanilla install of wordpress users have default entries like nickename, first_name, last_name and so forth in wp_usermeta. I'm not sure if that changes often or at all but I can't seem to ...
Floutsch's user avatar
1 vote
1 answer
2k views

How to pre-fill Google Forms URLs with logged-in WordPress user's data

We need to have our logged-in users' data (username , Email , First Name , Last Name) pre-fill the links to Google Forms existing on our site. Why? We have Google Forms spread out on our site that ...
marikamitsos's user avatar
1 vote
1 answer
3k views

Showing user ID on user main page from screen options

On the user main page in the screen options, you have some choices for displaying user information e.g.. e-mail, role, posts etc.. Is there a way to be able to display the user's unique ID?
Romes's user avatar
  • 455
1 vote
1 answer
3k views

User defined password at registration - registration email sends auto generated pass

Updating some meta fields on registration and providing the user the option to pick a password yet the registration email sends the auto generated password. User defined password works and not emailed ...
Justin W Hall's user avatar
1 vote
1 answer
14k views

generate unique number when registering a user

I know there are userID, username in the database, but I want a formatted and unique number for physical world use. For example: "2014xxxx" 201414:year,xxxx:generate randomly when registering a user....
pakwai122's user avatar
0 votes
1 answer
1k views

How to Make admin Sidebar Menu always be Collapse by code

I have solution with js that click on the Collapse button, but this is no good solution. I want to make this work true DB with php code. I found that the table who hold this value is wp_usermeta. ...
need-help's user avatar
  • 466
0 votes
1 answer
609 views

Extend user search in the Wp backend area on the users.php page to allow for searching by email domain and role from the "users search" input box

I have been looking to extend the ability to search users in the backend for some time and have tried variations of several functions recommended in these articles and posts along with others not ...
Johnathan's user avatar