Tightly integrating an open-source content management system with Salesforce provides a powerful and cost-effective way to increase engagement with our customers and make it easier to organize data without much manual overhead. In this article, we can learn how to integrate WordPress with Salesforce by saving the post in WordPress and get those post through REST API to Salesforce community/websites.
- WordPress is an open-source content management system
- It helps to create and manage our own website with less coding knowledge
- It is a versatile CMS and the most powerful tool for managing the blogs.
- Websites can be designed at low cost with more functionality.
WordPress is user-friendly and easy setup configuration. They provide so many plugins and themes for customization. Developer with less coding knowledge can design the websites. In salesforce we have some storage limit for data whereas in WordPress we can store large amount of data.
- Download and install WordPress and create an account.
- Add records/post in Post content type to be displayed in community.
- View the response through POSTMAN tool/browser and it will be in JSON format.
For getting post type response – https://yourdomain/wp-json/wp/v2/
Note: Replace your WordPress site URL instead of your domain the the above response.
Example URL: http://localhost/xyz/wp-json/wp/v2/posts
Remote site setting:
- It is used for registering the external site with Salesforce org.
- Once registration is complete, then we can access and share the external site data.
- Go to setup, enter Remote site setting and click the New button to create the connection.
- Enter an appropriate name to the Remote site Name and enter the external site URL.
- Enter the description for your site and save the site.
Note: Replace your Word press site URL in the Remote site URL
- Go to Setup, enter All sites, and click the community builder.
- Select your component, drag, and drop it in the community page.
- The component properties can be changed by using the popup in the right top corner (Example Type of content, category to fetch).
- Click the “Publish” button to view the post in the Community page.
- Finally, the Community page will display the posts that are posted in the WordPress.