Export User Metadata (7 posts)

  1. JohnP
    Posted 9 years ago #

    Ok, I've installed the Usermeta and Userextra plugins, set up fields in the Extended Profile for User addresses, phone numbers etc, and even included a checkbox stating whether they want a newsletter or not like in the screenshot.

    My question is now: how do I get the database to export a list of all the addresses of users who want the newsletter?

  2. squish
    Posted 9 years ago #

    Something like

    SELECT user_login,user_email from wp_usermeta
    LEFT JOIN wp_users on wp_users.ID=wp_usermeta.user_id
    WHERE wp_usermeta.meta_key="newsletter"
    AND wp_usermeta.meta_value="Yes"

    you might have to change the case of "newsletter" or "Yes".

  3. Edde Beket
    Posted 9 years ago #

    Does anyone have a plugin / php file that would show the extended user details to all users? I'd like to do so on a subscription only site (no public access) which is used for a reunion.

  4. miz
    Posted 9 years ago #

    I think you are looking for something like if you have added a field named address to the extended profile and you would like it to be displayed on your site right?

    If that is correct then you can use something like this to call on the address field

    <?php if($user->address) : ?>
    <p><strong>Contact Info:</strong>
    <br />
    Address: <?php echo $user->address; ?>
    <br />
    <?php endif; ?>

    You would put this in any php document and link to it or even put it in your index or sidebar etc.

  5. ic3y
    Posted 9 years ago #

    Could anyone plz upload the file (userextra for WP2.0) somewhere so i can download it? I want to download the plugin but the site has been down for days.

    Thanks in advance.

  6. Edde Beket
    Posted 9 years ago #

    @miz: thanks!

  7. likoma
    Posted 8 years ago #

    Miz, thank you so much! I've been wanting to figure this out for months and you finally put the final puzzle piece together for me.

    With this code and your PHP above, I can have a full list of members/users with any data I choose to put in there. Great for member sites and user levels (so not everyone can see everyone's details, etc.).

    Best regards,

    - Bradley

Topic Closed

This topic has been closed to new replies.

About this Topic