8.5 Sync contact data from CRM to WP
Let’s see how contact data can be synced. Let’s go to the CRM & add tags for a specific user. This tag should be added/updated immediately in our WordPress environment. There are 2 ways to make it work.
1. By a shortcode: we have a shortcode [lcw_contact_sync], and if you add this shortcode to a page and when a contact visits that page, the contact data will be updated by visiting that page.
2. By automation: This is the recommended way. create a workflow with the following trigger & webhook:
the trigger: Set the trigger to “Contact Changed” and add filters based on when you want the data to be sent to your WordPress site — for example, when tags or custom fields are updated.

The webhook: You need to set up a webhook that sends contact changes to your website.
In this webhook, set the METHOD to POST, the URL to your website URL
(you can directly paste your website URL, but we recommend creating a custom value and using that instead),
and add two CUSTOM DATA parameters with the following keys:
- lcw_contact_update with the value 1
 - 
    lcw_create_wp_user with the value 1
(this is needed if someone exists in the CRM but isn’t yet registered in WordPress).
This will create a new user in WordPress with the following data:- username: Email Address
 - email: Email Address
 - password: CRM contact ID
 
 
Screenshot: the workflow webhook.

We recommend using the automation method to sync your contact data, as it works efficiently and requires no manual intervention once set up.
The shortcode method can be used in specific cases where you need to sync a contact manually. However, note that each page load will send an API request to your CRM, so use this method sparingly.
