You are here:
Use Visualforce in Experience Builder Sites
If you created Visualforce pages, actions, buttons, links, and canvas apps for your Salesforce Tabs + Visualforce template-based sites, you can use them in Experience Builder sites.
Required Editions

For example, say that you have the Salesforce CPQ app installed in your org. You can create a quote detail page and use the Visualforce Page component to display the quote line editor or other pages. If you have configured actions, buttons, and links associated with standard or custom objects, they work in sites as well. And canvas app overlays let you host third-party applications in your site.
| Available in: both Salesforce Classic and Lightning Experience |
| Available in: Enterprise, Performance, Unlimited, and Developer Editions |
| User Permissions Needed | |
|---|---|
| To customize or publish an Experience Cloud site: |
|
-
Give Visualforce page access to users by profile.
- From Setup, enter Profiles in the Quick Find box, then select Profiles.
- Click the name of the profile that you want to modify.
- On the Profile page, in the Enabled Visualforce Page Access section, click Edit.
-
In the Available Visualforce Pages list, select the Visualforce pages that you want
to make available to this profile, and click Add.

- Save your changes.
-
Make the Visualforce page available for your site.
- From Setup, enter Visualforce in the Quick Find box, then select Visualforce Pages.
- Click Edit for the page that you want to make available for your site.
-
Select Available for Lightning Experience, Experience Builder sites, and
the mobile app, and save the change.If you want to use the page in an Experience Builder template, make sure that Require CSRF protection on GET requests isn’t selected, because it prevents the page from rendering.

Visualforce Page Component—To add a Visualforce page to your Customer Service site, drag the Visualforce Page component from the Components panel to the page. In the property panel, select the Visualforce page that you want to use.
Custom Actions—If you have custom actions with an action type of Custom Visualforce associated with a Visualforce page, these actions work in published sites. When users click the action button, the associated Visualforce page is displayed.
Important Visualforce overrides to standard actions such as View, New, Edit, and Delete aren’t supported in sites. These buttons on record detail pages don’t display in sites.Custom Buttons and Links—If you have custom buttons and links with a content source of Visualforce Page, these buttons and links work in published sites. When users click the button or link, the associated Visualforce page shows.
Note The Behavior setting for custom buttons and links isn’t supported. When users click custom buttons in published sites, the Visualforce page is always displayed in the current window.Experience Builder sites support custom list buttons with a URL source in published sites only if you deselect the display checkboxes (for Multi-Record Selection). If you select this option, the button doesn't work.
Canvas Apps—You can use canvas apps as custom actions to give users access to the functionality of your apps in sites. Configure your canvas app for Lightning Component and Visualforce Page in Canvas App Settings. You can then load the canvas app inside a Visualforce page, Visualforce action, and Lightning components in published sites.
Note Canvas apps and quick actions aren’t supported for guest users. They’re supported on sites only for logged-in users.You can opt to hide the publisher header and publisher Share button in Canvas App Settings.
Best Practices for Using Visualforce in Experience Builder Sites
- Site Branding—When developing your Visualforce page code, set the
showHeaderattribute totrue. That way, branding properties that you set in Administration | Branding in Experience Workspaces also apply to the Visualforce page component in your Customer Service site. To modify the default gray background for Visualforce components, change the Header Background property on the Branding page. - Mobile—To enable Visualforce pages to display site branding on mobile, set
standardStylesheets=trueorshowHeader=truein your Visualforce page code. - URLs—If your Visualforce page contains links to other Visualforce pages, make sure that
the Visualforce markup includes
http://orhttps://at the start of the URL. Also, if your page is locked in a frame, use thetarget="_top"attribute to open the page in the full body of the window. For example,<a href="https://yourVFpageURL.com" target="_top" >Name of Visualforce Page</a> - JavaScript Sources—Use JavaScript sources such as
connection.js,apex.js,debugshell.js, andutil.jsin Visualforce pages in either of the following ways:<apex:includeScript value="/soap/ajax/36.0/connection.js"/>orloadScript("/soap/ajax/36.0/connection.js") - Images—Hard-coded image URLs in Visualforce pages aren’t supported in Experience
Builder preview. We recommend that you upload images as static resources as
follows:
<img alt="{{msg.severity}}" class="msgIcon" src="{!$Resource.spacerImage}" title="{{msg.severity}}"/> - Standard page layouts—Visualforce pages embedded in standard page layouts aren’t supported in Experience Builder sites.
- Custom Theme Layouts—Visualforce pages always use the default theme layout when rendered in an Experience Builder site, even if you’ve applied a custom theme layout to your site pages.

