What’s the Mailchimp Sync Issue?
Recently I got assigned to a task where the customer accidentally disconnected the Mailchimp API integration and needed to re-connect and sync their Woocommerce shop with Mailchimp using the Mailchimp for Wordpress plugin.
Previous WordPress developer had already tried to connect and sync following the “Connect and Setup Mailchimp for Woocommerce” article. But, even though the connection was made, only a few customers were synced to the Audience. None of the orders or products were syncing.
So, I checked the Wordpress.org support forum of the plugin for possible reasons and found out that several other users reported the similar case.
What to Check for the Sync Issue?
Most recommendations I found were to check the following:
- PHP version’s compatibility with the Mailchimp plugin and WordPress core
- Fatal errors log in WooCommerce? (WooCommerce -> Status -> Logs)
- WordPress memory limit to be at least 1GB to accommodate the initial sync
- Verify that the sync issue is not related to a theme incompatibility
- Disconnect and re-connect Mailchimp with Woocommerce
- Reasons for failed actions in WooCommerce Scheduled Actions tab
After checking the Woocommerce logs, I found several “out of memory” critical errors and increased the WordPress memory by adding the following line to the wp-config.php file, just above the /* That’s all, stop editing! */ line.
define( 'WP_MEMORY_LIMIT', '2048M' );
I also checked the failed actions under WooCommerce > Status > Scheduled Actions tab to verify there are no errors associated with Mailchimp for Woocommerce plugin.
There were no signs of errors but still orders, products and contacts were not updating.
I contacted Mailchimp support by creating a ticket and then joined an online chat session with their support member by enabling the remote support feature in the Advanced tab of the plugin.
As expected, that didn’t help. They stated that it would take usually 24 hours for the initial sync and suggested me similar troubleshooting steps that I specified at the beginning of this article.
Having waited for a couple of hours as per Mailchimp support’s suggestion, nothing has changed and sync was still stuck. So, I proceeded with the following troubleshooting steps that did the trick.
Resolving Sync Issues with the Plugin
Doing several tests with the website I found out that new user subscriptions, new orders or adding a new product / changing a product’s stock quantity were triggering the Mailchimp plugin to sync. So, the plugin was working properly. But the old order and products data was still not syncing.
You can do the following tests to check the sync stuck issue
- If new orders are syncing, but the backlog (previous orders) remains stuck,
- If new products are syncing, but the older products are not,
- If new customers are syncing, but the existing customers are not (or sometimes partially synced depending on their presence on the Mailchimp audience)
I had tested for all these cases and found that plugin and API connection was working properly. So, I needed to trigger the sync of existing customers, orders and products.
How I Solved the Sync Issue?
To trigger the sync, I moved the products and orders to Trash and then restored them.
NOTICE: Before attempting this, I highly recommend you to create a backup of your website using Updraft Plus plugin. As, the solution requires temporarily moving products and orders to the trash, you can accidentally delete them permanently.
Prior to applying the fix, I had 0 products synced. After I moved 750 products to the trash and restored, they got properly synced in about an hour.
Other Solutions That Might Help
- Mailchimp for Woocommerce plugin requires website traffic to trigger the scheduled actions (queued jobs). If your website doesn’t have enough traffic, try using a site checker to ping the website every minute or every 5 minutes to trigger queued jobs.
- Large websites might have thousands of completed, processing or failed Scheduled Actions. When they pile up, WordPress might fail to run the necessary actions which are used for Mailchimp sync. Clean the scheduled actions tables using a plugin or directly from the database using Phpmyadmin.
- Cache plugins (especially the ones that use object-cache) may cause issues with the sync. Try disabling the feature and checking if the sync is still stuck.
- Instead of disconnecting and re-connecting the Mailchimp, try the re-sync option in the Advanced tab.
- If you can’t diagnose and address the fatal errors in WooCommerce status logs request help from a WordPress Expert.
- Keep an eye on the community page for updates on new versions and plugin releases.
- Check out the suggestions and ideas from the community to help resolve the issue.