Specify Trusted Domains for Inline Frames
To allow external sites to load your Visualforce pages or surveys in an inline frame (iframe), add the domain to an allowlist in Session Settings.
Required Editions
| Available in: both Salesforce Classic and Lightning Experience |
| Available in: Contact Manager, Group, Professional, Enterprise, Performance, Unlimited, and Developer Editions |
| User Permissions Needed | |
|---|---|
| To modify session security settings: | Customize Application |
This topic covers inline framing for Visualforce pages. To specify trusted domains for Experience Cloud sites and Salesforce Sites, see Enable Clickjack Protection for Experience Builder Sites and Enable Clickjack Protection in Site.com in Salesforce Help
- Determine the domains that you trust to frame your Visualforce pages.
When you determine the external domains to allowlist, remember to include these domain types.
- Custom domains—Domains that you own, such as https://www.example.com that
serve your site content.You can find your custom domains on the Domains page in Setup. For more information, see View Your Custom Domain Details in Salesforce Help.
- Visualforce pages delivered by a managed package.These pages use the URL format
MyDomainName--PackageName.vf.force.comin production andMyDomainName--SandboxName--PackageName.sandbox.vf.force.comin a sandbox. To find the URL formats for other non-production orgs, see Partitioned Domains in Salesforce Help.To get the package names for the package-delivered Visualforce pages for your org, use the Namespace Prefix column on the Visualforce Pages page in Setup.
Note Visualforce pages in Salesforce-delivered packages usecas the package name and aren’t treated as external sites.
- Custom domains—Domains that you own, such as https://www.example.com that
serve your site content.
- From Setup, in the Quick Find box, enter Session Settings, and then select Session Settings.
- In the Trusted Domains for Inline Frames section of the Session Settings Setup page, click Add Domain.
- Enter the domain.Acceptable formats are example.com, https://example.com, and *.example.com.
- Select the allowed IFrame Type for this domain.
- To allow the specified domain to load Visualforce pages in an iframe, select
Visualforce Pages and save your changes.If clickjack protection is enabled for the Visualforce page, the domain is added to the Content Security Policy (CSP)
frame-ancestorsHTTP response header for the corresponding Visualforce pages. For example,'self' abc.com *.my.site.com. For more information, see Enable Clickjack Protection for Visualforce Pages in Salesforce Help.If clickjack protection isn’t enabled for the Visualforce page, then all external websites can load the Visualforce page in an iframe. For more information, see Configure Clickjack Protection in Salesforce Help.
- To allow the specified domain to load surveys in an iframe, select
Surveys and save your changes.The domain is added to the CSP
frame-ancestorsHTTP response header for Survey pages. For example,'self' abc.com *.my.site.com. - To allow the specified domain to load disclosures in an iframe, select Disclosure and Compliance Hub Connector and save your changes.
- To allow the specified domain to load Visualforce pages in an iframe, select
Visualforce Pages and save your changes.
- To edit a domain in your Trusted Domains for Inline Frames list, click Edit for that domain.
- To delete a domain in your Trusted Domains for Inline Frames list, click Del for that domain.
To load authenticated Visualforce pages in an iframe, additional steps are required. See Put Visualforce Pages on External Domains in the Visualforce Developer Guide.

