plugins - How To Export User's Custom Fields in CSV or XLSX

Hi Guys I have a BIG problem.. I'm using Eduma LMS and I have 2 type of customers... Some buy single video course,

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

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

Share Improve this question asked Jul 15, 2019 at 15:37 Mauro LangiuMauro Langiu 31 bronze badge 2
  • 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 Commented Jul 15, 2019 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 Commented Jul 15, 2019 at 18:54
Add a comment  | 

1 Answer 1

Reset to default 0

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.

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745319504a4622377.html

相关推荐

  • plugins - How To Export User&#39;s Custom Fields in CSV or XLSX

    Hi Guys I have a BIG problem.. I'm using Eduma LMS and I have 2 type of customers... Some buy single video course,

    8小时前
    40

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信