Hi Guys I have a BIG problem.. I'm using Eduma LMS and I have 2 type of customers... Some buy single video course, some others buy a membership (managed by Paid Membership Pro).

When a user buy a product or a membership he/she it has to fill a required custom field (codice snep). That is the ID number of their network marketing account.

Today the company asked me for a CSV files with all their names and the ID codice snep.

I tried to export with some plugins but all of them ignore that custom field (ID) codice snep..

How can I export it too? The free plugins are not working :( They just export the basic fields of wp, ignoring custom fields.

Thank u in advance! <3

  • Can you query the database directly? You should be able to do a simple join of wp_user and wp_usermeta (where key = the key you're using for codice snep ID), and your SQL workbench will let you export the output as CSV or Excel. – Rup Jul 15 '19 at 17:41
  • Thank you Rup! Yes I can but I don't know how to properly do the query. Could u help me? I need these fields to be exported: first_name | last_name | billing_codice_snep | codice_snep How can I do an export of these 3 fields only? :o – Mauro Langiu Jul 15 '19 at 18:54

Probably the easiest way to do this is to connect to the database using MySQL Workbench or similar, and extract the data using a SQL query e.g.

select u.user_login, u.user_email,
       m1.meta_value as first_name, m2.meta_value as last_name,
       m3.meta_value as billing_codice_snep,
       m4.meta_value as codice_snep
  from wp_users u
  left join wp_usermeta m1 on m1.user_id = u.id and m1.meta_key = 'first_name'
  left join wp_usermeta m2 on m2.user_id = u.id and m2.meta_key = 'last_name'
  left join wp_usermeta m3 on m3.user_id = u.id and m3.meta_key = 'billing_codice_snep'
  left join wp_usermeta m4 on m4.user_id = u.id and m4.meta_key = 'codice_snep'

and then you can use Workbench's export to save this as a CSV or XLSX.

I'm guessing that you have called your user meta fields 'codice_snep' and 'billing_codice_snep'. If not, you'll have to change the last two lines of the query with the correct user meta keys.

  • You are Amazing Bro! Thank you! U solved my problem! This worked perfectly. <3 – Mauro Langiu Jul 16 '19 at 12:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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