M2 creating user meta fields

Membership 2 Pro plugin is creating user meta fields in the admin user side. Could notice the issue , when I try to create custom field via Admin Columns plugin, as shown in the screenshot.

http://www.screencast.com/t/YDROZSXJt7z

Would like to know how to remove these custom fields created by Membership 2 Pro plugin. Please check the chat notes for more info.

  • Adam Czajczyk

    Hello Eran Heres

    I hope you're well today and thank you for your question!

    These custom fields come from the "Additional Automated Messages" Membership 2 Pro add-on. Those particular ones shown on the screenshot should be related to "Subscription -> Before expires" e-mail message which, I believe, must be configured for at least some memberships on the site.

    There's no way to disable then "out of the box" other than disabling that message but even then the fields (custom user meta) would remain in the database (those that were already created).

    Plugin is using those fields to set the automated messages' queue and mark which ones are already sent and when.

    That being said, I've also pushed the question to our developers if we can somehow limit the number of these fields. While they are necessary for the plugin to work (if the aforementioned add-on is active) I believe that it might not be necessary to keep all "archive" fields there and some automated clean up could be a good addition to the plugin.

    Please keep an eye on this ticket for further information (just note please that developer's response time might be longer than ours here on forum as they deal with a lot of complex issues on daily basis).

    Best regards,
    Adam

  • Eran Heres

    Hi, thanks for the update. I understand the reason for those fields, but I think the solution is extremely suboptimal. If I have thousands of users, I'll have thousands of columns in my users SQL table, with just one checkmark per user in all those thousands of columns. Wouldn't it make more sense to just have one column per message category (e.g. sent_before_expires) that would hold the date when the message was sent to a particular user?

  • Paul Kevin

    Hey there Eran Heres ,

    Hope you are well today, sorry for the late response on this. I have changed how the meta values are saved (It will all be contained in one array instead of separate meta keys). This will be available in the next release. In the meantime you can delete meta data using the query

    DELETE From wp_usermeta where meta_key like 'ms_comm_before_finishes%';

    Warm Regards
    Paul Kevin

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.