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

Basically i have front end form which store the notes and tags of post. And every user who logged in can store there own notes and tags. But i want when he view the notes and tags he can only see here own notes and tags not all the notes and tags of every one.

For example there are 100 post there. Every user have an option to save notes and tags of each post and no one other can be able to see there notes and tags. so when user logged in he can able to view there notes and tags which he added.

share|improve this question
up vote 1 down vote accepted

There are various ways to achieve this you can either generate metakey value for update_post_meta in such a way that it will contain user id.

//Example :
global $user_ID,$post_ID;
// Store the values
update_post_meta($post_ID, 'meta_key'.$user_ID, '$meta_value');
// Get the values
$meta_values = get_post_meta($post_ID, 'meta_key'.$user_ID);

or you can save it in user meta as following

//Example :
global $user_ID,$post_ID;
// Store the values
update_user_meta( $user_ID, 'meta_key'.$post_ID, 'meta_value' );
// Get the values
$meta_values = get_usermeta( $user_ID, 'meta_key'.$post_ID );
share|improve this answer
Thanks bro its working great – Adi Mar 7 '13 at 9:03
You can accept my answer if its working for you. – Vinod Dalvi Mar 7 '13 at 9:15

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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