• Resolved dgstr

    (@dgstr)


    I need to export my wordpress’ users list to Zoho CRM or Google Docs.

    Is there any way to do this?
    I have already searched a lot, and found WordPress and Zoho integrations, but no one about exporting user data.

    Is possible to do this?

    Thanks!

Viewing 15 replies - 1 through 15 (of 15 total)
  • Moderator bcworkz

    (@bcworkz)

    There’s several plugins that export user data in one form or another. It will probably take some custom coding to transform the export data into a form compatible with the destination app.

    It may be easier to create a custom plugin that loops trough the users tables and directly creates the properly formatted file.

    Thread Starter dgstr

    (@dgstr)

    And what about some way to save user data as .CSV or Google Docs spreadsheet?
    It would help a lot!

    I’ve searched some plugins but no one helped me.

    Thank you.

    Moderator bcworkz

    (@bcworkz)

    If CSV is acceptable use phpMyAdmin to export the users table in CSV format.

    Thread Starter dgstr

    (@dgstr)

    This worked! Thank you very much!

    But there is any way that I can obtain too the user first_name and last_name? Because in the wp_users table these infos are not included.

    Moderator bcworkz

    (@bcworkz)

    Yes, it’ll be more involved to relate the name data to the CSV row. The names are in usermeta, indexed by user ID. You can export the table easily enough. You’d then need a script to search through the meta data looking for the correct ID and keys, then extracting the data and appending it to the correct user line in the CSV data.

    Or your script could query the DB for the name data and append it to each user line in the CSV data. This is probably easier, but has to be done on your server. The export usermeta approach can be done on any computer in any language.

    I concur with bcworkz. You can access phpmyadmin on the server and execute a query in which it selects the fields that you want from one or more tables and then you can export it as CSV.

    Thread Starter dgstr

    (@dgstr)

    And how can I do that? I don’t know much of phpmyadmin.

    A solution that I’ve found is change de display_name of the users automatically to the first_name and last_name, so the displayname field in table is the first and last name of the user.

    Here’s what the query to run in phpmyadmin would look like:

    SELECT user_login, user_email, meta_key, meta_value FROM wp_usermeta, wp_users WHERE wp_users.ID = wp_usermeta.user_id AND meta_key <> 'nickname' AND meta_key <> 'description'AND meta_key <> 'rich_editing' AND meta_key <> 'comment_shortcuts' AND meta_key <> 'admin_color' AND  meta_key <> 'use_ssl' AND meta_key <> 'show_admin_bar_front' AND meta_key <> 'wp_capabilities' AND meta_key <> 'wp_user_level' AND meta_key <> 'dismissed_wp_pointers' AND meta_key <> 'show_welcome_panel' AND meta_key <> 'wp_dashboard_quick_press_last_post_id' AND meta_key <> 'edit_page_per_page' AND meta_key <> '_order_count' AND meta_key <> 'wp_user-settings' AND meta_key <> 'wp_user-settings-time'

    Of course, you are free to append more conditions to the end based on specific meta_key(s) you don’t want.

    Thread Starter dgstr

    (@dgstr)

    Thank you very much! That worked so well!

    Is there anyway phpmyadmin can make a horizontal table?
    Anyway, thank you again!

    You are welcome!

    I am not sure what you mean by “horizontal table”?

    Thread Starter dgstr

    (@dgstr)

    I will try to explain…

    phpmyadmin is showing me (and the same when I export do CSV) tables with a layout like this:
    Title 1 – User1-info
    Title 2 – User1-info
    Title 3 – User1-info
    Title 1 – User2-info
    Title 2 – User2-info
    Title 3 – User2-info

    But I want (and need to import in other site) a table like this:
    Title 1 | Title 2 | Title 3
    User1-info | user1-info | user1-info
    User2-info | user2-info | user2-info

    I don’t know if I explained well…
    I mean something like: phpmyadmin shows me a table with titles in the rows (with the users info in it right side), but I need a table with title in columns (with the users info at the bottom).

    The way the CSV is made from the original query is the only format that WordPress will recognize when you import it in another site. If one changes the layout of the CSV before importing it into another site, WordPress will not render data correctly.

    Thread Starter dgstr

    (@dgstr)

    It’s for administrative uses and other content managers, not specifically wordpress.
    Is there any way to change the table layout?

    Oh I see. Yes, you can change the table layout and you can do it with Excel.

    Thread Starter dgstr

    (@dgstr)

    Ok, thank you very much!

    I will mark this topic as resolved.
    Thanks again, respectyoda and bcworkz!

Viewing 15 replies - 1 through 15 (of 15 total)
  • The topic ‘Exporting WordPress User List’ is closed to new replies.