For any supported WordPress content types (e.g. post, page, user, or any supported custom content type in your installation), you can assign Salesforce objects that will be created / updated / deleted when the data in WordPress is saved, and the WordPress objects can be created / updated / deleted when the data in Salesforce is saved.
For each such combination of object and content type, choose which fields should be mapped to one another, creating a fieldmap. The plugin acts on matching data after it is installed.
This plugin also includes developer hooks that allow for additional plugins to modify what data the plugin is working with, or what happens upon specific events.
The plugin documentation contains initial setup instructions. This is the fastest way to get the plugin running on your site.
We maintain extensive documentation of the plugin beyond its installation process as well, including its developer hooks. This documentation also exists in the plugin’s
docs folder when it is downloaded.
Mapping custom fields
WordPress stores metadata as key/value pairs in its database. Many plugins and themes use this method to store custom field data. Object Sync for Salesforce supports mapping these fields (many other plugins use non-standard methods, and this plugin may or may not support them).
There’s a helpful spreadsheet (we are not affiliated with it, we just think it’s useful) comparing various options for custom fields you can review. If the plugin you wish to use uses Meta-based Storage (listed in the spreadsheet), you should be able to use it with Object Sync for Salesforce, but how well they work together will vary. Plugins with full meta compatibility (also listed in the spreadsheet) may work the best, but you don’t have to restrict yourself to those.
Object Sync for Salesforce, however, cannot see meta fields before the field has at least one value in the database. For example, if you have a “testfield” on your user object, it won’t be in the fieldmap options until there is at least one user that has a value for the field.
If you load Object Sync for Salesforce and then store data for a new meta field after this load, make sure you click the “Clear the plugin cache” link on the Fieldmaps tab.
Mapping required fields
Related to the mapping of custom fields, but raising its own distinct questions and problems that can make this plugin more complicated, is the issue of mapping between required fields in WordPress or Salesforce.
How WordPress handles meta fields
This plugin runs on WordPress’ core actions for user, post, comment, attachment, and term objects, which run when those objects are created or deleted. This plugin also runs on WordPress’ meta actions for those objects. The way WordPress works is that these actions don’t happen together, so metadata is generally not part of the core action’s dataset.
How this affects required fields
The way these actions work means that if a field is required in Salesforce, it needs to be sent as part of the first, core WordPress action associated with the WordPress object. If it is only added as part of the second action, the metadata, it will not be sent and the Salesforce operation will fail.
How this works in detail can vary for different WordPress object types. Some examples:
- WordPress user objects: this plugin runs first on the
user_registeraction. The initial action has access to data stored in
wp_user. It also has access to some fields that are stored in wp_usermeta (
last_name), but it does not have access to custom user fields.
- WordPress post objects (this also includes attachments and custom post types): this plugin runs first on the
save_postaction. This means it has access to data stored in
wp_postsonly, not data stored in
- WordPress term objects: this plugin runs first on the
create_termaction. This means it only has access to the Term ID, Term Taxonomy ID, and taxonomy data, not other custom fields.
- WordPress comment objects: this plugin runs first on the
comment_postaction. This means it has access to the comment ID, whether the comment is approved, and the comment data array.
Again, this all applies to the first operation the plugin runs, which is when Salesforce will expect to receive required fields.
If you are storing a required field’s value in a meta field in WordPress, you will run into errors if it is not sent as part of the first action.
- WordPress user objects: this plugin runs first on the
Syncing pre-existing data
This plugin was built to sync data that is created after it was installed. However, there are some techniques that can import pre-existing data. See the Import & Export section of the documentation for methods you can use for this.
Using with ACF (Advanced Custom Fields)
Object Sync for Salesforce does not and will not “officially” support ACF because you don’t have to use ACF to use WordPress or to use Salesforce. However, they are generally usable together.
Things to know:
- See the answer above about custom fields. Any ACF field must have at least one value in the database before Object Sync for Salesforce can map it.
- When you try to map an ACF field, you’ll see one that has an underscore in front of it, and one that does not. This is because ACF uses both for its own purposes. As long as you map the ACF field that does not have the underscore in front of it, you should be able to get data to and from Salesforce. For example, you could map a
Contact_descriptionfield. The fieldmap screen will show a
_test_fieldin the dropdown, but you should be able to safely ignore that, and only map
While we will not include code that only runs for ACF in this plugin, we would happily point to any add-on plugin that uses Object Sync for Salesforce hooks to build a more comprehensive integration with ACF for all users who install this plugin while they’re running ACF.
Using with WooCommerce
Object Sync for Salesforce doesn’t have, and will not have, intentional support for WooCommerce. It kind of supports it, to the extent that WooCommerce uses WordPress’ default ways of creating objects and data. WooCommerce is very complicated, and on top of that it often deviates from those default WordPress methods, and it’s certainly possible that this plugin won’t support it when it does.
This doesn’t mean you can’t use them together, but it does mean this plugin is not intentionally built for that purpose. Because WooCommerce is not a requirement to use WordPress, or to use Salesforce, it will never be built directly into Object Sync for Salesforce.
Object Sync for Salesforce does have abundant developer hooks, and WooCommerce has its own API, and it would be possible to build an add-on plugin to provide full support by integrating these (we would happily point to it for all users who install this plugin while they’re running WooCommerce).
If you are having trouble setting up or configuring the plugin, we’ve provided answers to some common problems in our troubleshooting document. Expanding this document is also a great way to contribute to this plugin.
There is extensive documentation of this plugin, including its developer hooks, on GitHub. This documentation also exists inside the
docsfolder when you download the plugin from the WordPress directory.
Getting support using this plugin
We make an effort to answer support requests in the WordPress plugin forum. If you have these requests, please put them in that forum only. Do not send them by email or by social media.
While MinnPost’s nonprofit newsroom does welcome donations to support our work, this plugin does not have a paid version.
Use the plugin’s GitHub repository for bugs, feature requests, and other additions and especially do that if you can help solve these things.
Extending this plugin
WordPress developers can use hooks in this plugin to extend its functionality. These are listed, with links to each hook’s documentation, in the developer hooks documentation, and are frequently mentioned throughout the plugin’s documentation.
We host a document intended to list plugins that use these hooks or otherwise extend this plugin, and we welcome additions.
Contribute to plugin development
If you’d like to suggest a feature, or if you think you’ve encountered a bug, you can create an issue on our GitHub repository. We actively add our own issues to the list, and comment on their progress.
We welcome contributions of code, documentation, or translations to this project from other developers. See our contributing guidelines.
Finding other sync options
This plugin can be relatively complicated, and sometimes other plugins can effectively integrate Salesforce and WordPress, especially if there are more limited, specific requirements. If one of these can meet those requirements, use it. We’re happy to link to additional choices here, as well.
- WordPress-to-Lead for Salesforce CRM can be installed through the Salesforce AppExchange. It allows you to run a contact form which users on your WordPress site can submit, and the results are added to Salesforce as a Lead object.
- Brilliant Web-to-Lead for Salesforce can be installed through the WordPress plugin directory. This is rather similar to the first option, but is a bit more customizable. By customizable, you can select the fields in WordPress and theme it in your WordPress theme.
- Gravity Forms Salesforce can be installed through the WordPress plugin directory. It is quite powerful, as it can send form submissions from your WordPress site to Salesforce as whatever object you need. It’s important to mention that this works for any form created with the Gravity Forms plugin. It’s also important to mention that this does not sync data back from Salesforce into WordPress.
- WP Fusion Lite can be installed through the WordPress plugin directory. This plugin is able to sync WordPress user records with contacts from different CRMs (including Salesforce) and manage content access based on tags it uses. This plugin also has a paid version that integrates with other WordPress plugins.
- WooCommerce Salesforce Integration can be installed through the WordPress plugin directory. This plugin is able to create records in Saleforce when orders are placed through WooCommerce. This plugin also offers a premium version.
- Third party integration apps such as Zapier are subscription-based, paid ways to integrate different systems, and they offer differing amounts of customizability. They will usually sync in both directions, so in this case from WordPress to Salesforce and vice versa. The only limitations of something like this are the cost over time, and the possible vulnerability of basing an integration on a third party that could, at some point, go away.
- Visualforce If you are or have a Salesforce developer, you can build MVC based applications that integrate with Salesforce. It would be possible to build a system that uses, for example, the WordPress REST API to send and receive data to and from WordPress. This could be, in many ways, the flip side of what our plugin here does, but the complexity would be the same if the scope was the same.
- Build other integrations in WordPress this plugin focuses on the Salesforce REST API, as it covers the integration needs we have. It also provides some support for the SOAP API, primarily to detect merges of Salesforce records. Salesforce also has other developer options: the Bulk API, and the Metadata API, the Analytics API, and likely more functionality that is only in SOAP. Developers could extend this plugin to integrate with one of these. We would welcome any pull requests!
Contributors & Developers
“Object Sync for Salesforce” is open source software. The following people have contributed to this plugin.Contributors
Translate “Object Sync for Salesforce” into your language.
Interested in development?
Browse the code, check out the SVN repository, or subscribe to the development log by RSS.
See our full changelog for information about all previous releases.