Question

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

Was it helpful?

Solution

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with wordpress.stackexchange
scroll top