How to Delete Entries from mw_list_field_value for Deleted Subscribers to Re-enable Them for Future Follow-Up Sequences

gvero

New Member
Hello Mailwizz Community,

I'm currently managing a subscriber list in Mailwizz and have encountered an issue that I could use some assistance with.

Problem Description:

I have subscribers who were previously deleted from my Mailwizz list by me using the bulk delete option. These subscribers may decide to re-subscribe to the list on their own in the future. However, I'm noticing that when these subscribers attempt to re-join the list, they aren't being treated as new entries. This seems to be due to their information still existing in the mw_list_field_value table, which likely prevents them from being fully re-added to the list and included in the follow-up sequences.

Objective:

I need to delete the entries in the mw_list_field_value table associated with subscribers who have been deleted from the list. This will ensure that when they re-subscribe, Mailwizz will recognize them as new subscribers, allowing them to be properly included in the follow-up sequences.

Questions:

  1. Is there a recommended way to identify and safely delete the relevant entries from the mw_list_field_value table for these deleted subscribers?
  2. Are there any potential risks or side effects I should be aware of when performing this deletion?
  3. Is there an automated process or a best practice for ensuring that deleted subscribers can re-subscribe and be treated as new entries in the future?

I would greatly appreciate any guidance or recommendations from the community on how to approach this issue.

Thank you for your support!
 
I have subscribers who were previously deleted from my Mailwizz list by me using the bulk delete option
I'm noticing that when these subscribers attempt to re-join the list
Deleted subscribers are removed for good from list, together with absolutely all their information.

Maybe you unsubscribed them? But even so, they should be able to re-subscribe without any issue.
What is the exact error message they get?
Are you suing latest version of MailWizz?

I need to delete the entries in the mw_list_field_value table associated with subscribers who have been deleted from the list.
If you have records in this table, for subscribers that don't exist, then there's something wrong with your database, MaiLWizz sets foraign keys on tables so that the data is deleted in cascade when related data is removed.
Do not remove data from anywhere manually, always do it from MailWizz itself.
 
Deleted subscribers are removed for good from list, together with absolutely all their information.

Maybe you unsubscribed them? But even so, they should be able to re-subscribe without any issue.
What is the exact error message they get?
Are you suing latest version of MailWizz?


If you have records in this table, for subscribers that don't exist, then there's something wrong with your database, MaiLWizz sets foraign keys on tables so that the data is deleted in cascade when related data is removed.
Do not remove data from anywhere manually, always do it from MailWizz itself.
Thank you for your prompt reply.

Just to clarify, I'm not encountering any error messages. I have a custom script that automatically deletes subscribers based on their inactivity after X days. This script removes subscribers from the list, and as you mentioned, they should be removed completely along with all their information.

However, when I checked, I noticed that if I re-join my list after being removed, I do not receive any follow-ups. Through my investigation, I found that this issue seems to be linked to the data remaining in the mw_list_field_value table.

Would you like to take a look at my custom script? I can send it to you via PM if that would help in diagnosing the issue.

Thanks again for your assistance!
 
hrough my investigation, I found that this issue seems to be linked to the data remaining in the mw_list_field_value table.
Can you check and see if that tables has any foreign keys set, specifically the subscriber_id column should point to list_subscriber table at the subscriber_id column. Again, if you remove a subscriber from the list_subscriber table, everything should cascade and all the data will be removed, including everything that is in the list_field_value table.
However, when I checked, I noticed that if I re-join my list after being removed, I do not receive any follow-ups
There must be another reason for this, if your new subscriber has been added to the list, it has been added with a new id, as a new subscriber, so it has new records everywhere.
Would you like to take a look at my custom script? I can send it to you via PM if that would help in diagnosing the issue.
Can't do this, sorry. It shouldn't matter either. But keep in mind MailWizz has a command for removing inactive subscribers.
 
Can you check and see if that tables has any foreign keys set, specifically the subscriber_id column should point to list_subscriber table at the subscriber_id column. Again, if you remove a subscriber from the list_subscriber table, everything should cascade and all the data will be removed, including everything that is in the list_field_value table.

There must be another reason for this, if your new subscriber has been added to the list, it has been added with a new id, as a new subscriber, so it has new records everywhere.

Can't do this, sorry. It shouldn't matter either. But keep in mind MailWizz has a command for removing inactive subscribers.


I wanted to update you—I made a mistake in my previous message. My custom script is actually working fine and deletes subscribers as expected.

The issue I’m encountering occurs when I use the MailWizz bulk action from the source feature to delete subscribers. I’ve noticed that while the records are correctly removed from the mw_list_subscriber table, they remain in the mw_list_field_value table.

This seems to be causing problems when those subscribers try to re-join the list, as their previous data is still lingering in the database.
 

Attachments

  • mailwizz-mw_list_subscriber.png
    mailwizz-mw_list_subscriber.png
    59.4 KB · Views: 4
  • mailwizz-mw_list_subscriber-after-delete.png
    mailwizz-mw_list_subscriber-after-delete.png
    53.7 KB · Views: 4
  • mailwizz-mw_list_field_value.png
    mailwizz-mw_list_field_value.png
    28 KB · Views: 4
Are you sure your tables have foreign keys set?
Go to phpmyadmin in the list fielfd value table and click the Structure tab then Relational View. And add a screenshot from there, from the "Foreign key constraints" section.
 
Are you sure your tables have foreign keys set?
Go to phpmyadmin in the list fielfd value table and click the Structure tab then Relational View. And add a screenshot from there, from the "Foreign key constraints" section.
 

Attachments

  • mailwizz-mw_list_field_value_Foreign_key.png
    mailwizz-mw_list_field_value_Foreign_key.png
    34.5 KB · Views: 4
Yeah, as I thought, for some reason, you don't have foreign keys on this table, even though, the installer adds them during the install process.
Can you check other tables and see if they have foreign keys, like the list and/or the subscribers table?
 
I checked the mw_list and mw_list_subscriber tables as you suggested, and it turns out they don’t have foreign keys either. It seems like this might be the root of the issue.

Is there any way to fix this? Perhaps by manually adding the foreign keys, or is there a recommended approach to ensure the database structure is correctly set up with all necessary constraints? I'm open to any suggestions you might have.

Thanks again for your help!
 
Unfortunately its very difficult to say how much has been affected by this, so you'd need to go table by table and check FK's, which is siomething that will take days. I thing, realistically, your only chance is to do a fresh install, then check to see if the FKs were added.
Its very weird that this has happened, I don't have a clear explanation for it though.
 
Unfortunately its very difficult to say how much has been affected by this, so you'd need to go table by table and check FK's, which is siomething that will take days. I thing, realistically, your only chance is to do a fresh install, then check to see if the FKs were added.
Its very weird that this has happened, I don't have a clear explanation for it though.
Thank you for your insights. I’ve checked my other MailWizz installations, and they all have the foreign keys properly set up, so this issue seems to be isolated to this one instance.

Given the complexity of checking each table and the uncertainty around how much has been affected, I’m considering a fresh install as you suggested. However, before I proceed, I’m curious about a potential temporary workaround:

If I manually empty the mw_list_field_value table after each bulk delete from the source action, what are the risks or potential issues I might face? Would this approach cause any unintended side effects or data integrity problems?
 
If I manually empty the mw_list_field_value table after each bulk delete from the source action, what are the risks or potential issues I might face? Would this approach cause any unintended side effects or data integrity problems?
Yeah, that won't work because there's that much data referenced between tables, and you will end up with a lot of orphaned data between tables, in the long run, it will be a mess, better reinstall now when is not too late.
 
Apologies for the delay in replying.

This MailWizz installation is a few years old, and the database has grown to around 2GB of data. I was wondering if it might be possible to attach the missing foreign keys from a working database export/import?
 
You can try to attach them, just look in /apps/common/data/update-sql which contains all sql queries executed during upgrades, so you can pick a version which has keys but your database doesn't, and start from there. But it will be painful.
 
Back
Top