CustomSite defines a Salesforce Sites or Visualforce site: a public website or application integrated with a Salesforce org that visitors can access without logging in. It controls activation, entry and error pages, exposure of standard pages, browser protections, URL routing, and selected guest-user settings. It can also associate a portal for authenticated access.
CustomSite is not the complete definition of an Experience Cloud site. Experience Cloud uses Network, which can reference a CustomSite. The exposed siteType values are Visualforce, Siteforce, ChatterNetwork, and ChatterNetworkPicasso. For the Experience Cloud definition, see the Network reference.
Key Elements
| Element | What the Element Controls |
|---|---|
active |
Required Boolean that determines whether the site is active. |
indexPage, inactiveIndexPage, inMaintenancePage
|
Visualforce pages for the active home page, inactive home page, and maintenance response. indexPage is required; these are separate page assignments. |
siteType |
Required site classification. Allowed values are Visualforce, Siteforce, ChatterNetwork, and ChatterNetworkPicasso. |
allowHomePage, allowStandardAnswersPages, allowStandardIdeasPages, allowStandardLookups, allowStandardSearch
|
Expose their respective standard pages to public users. These switches have a different audience from allowStandardPortalPages. |
allowStandardPortalPages |
Controls authenticated users' access to standard Salesforce pages through the site. true still requires the user's access controls to permit access; false blocks those pages even when access controls permit them. |
enableAuraRequests |
Controls whether guest users can load features available only in Lightning. Those features do not load when this is false. |
guestProfile, siteAdmin, siteGuestRecordDefaultOwner
|
Respectively identify the guest user's read-only profile reference, the administrator's username, and the username of the owner of all new records created by unauthenticated guests. |
customWebAddresses |
Replacement collection for the site's root custom URLs. Each entry has required domainName and primary values, plus an optional certificate reference for Salesforce-served HTTPS. |
redirectToCustomDomain |
Redirects system-managed site URLs to an associated HTTPS custom domain. The default for Salesforce Sites is true; the default for Experience Cloud sites is false. |
fullName, masterLabel, urlPathPrefix
|
Separate component identity, required user-interface label, and the first URL path segment that distinguishes the site from other sites. |
siteRedirectMappings |
Individual URL redirect rules. Each rule has its own isActive state, an action of Permanent or Temporary, a relative source, and a relative or fully qualified target. |
clickjackProtectionLevel, siteIframeWhiteListUrls
|
Control framing of the site inside other pages. Levels are AllowAllFraming, External, SameOriginOnly, and NoFraming. The whitelist collection records trusted external framing domains in nested url values. |
browserXssProtection, contentSniffingProtection, referrerPolicyOriginWhenCrossOrigin
|
Required browser-protection settings for reflected cross-site scripting, inferred content types, and disclosure of full URLs through referrer headers. |
cachePublicVisualforcePagesInProxyServers |
Defaults to true, allowing proxy caching of public pages for unauthenticated guests. false does not disable all caching. |
favoriteIcon, serverIsDown
|
Reference static resources for the browser icon and the cached response used when Salesforce servers are down. serverIsDown has specific ZIP-file requirements. |
Behavior and Constraints
Activation and page selection. active controls activation, while indexPage identifies the active site's Visualforce home page. inactiveIndexPage identifies the inactive home page. Neither is the same setting as inMaintenancePage, which supplies the maintenance response.
The error-page selectors also have distinct purposes. authorizationRequiredPage handles a guest user's unauthorized access, fileNotFoundPage handles nonexistent pages, bandwidthExceededPage handles bandwidth-quota exhaustion, and genericErrorPage handles errors not otherwise specified. siteTemplate selects the Visualforce template, and robotsTxtPage supplies the page used for the web-crawler robots.txt response. CustomSite does not support syndication feeds.
Public and authenticated access. The public-page switches do not replace the authenticated-user restriction in allowStandardPortalPages. Setting allowStandardPortalPages to false adds a restriction for sites intended to serve only Visualforce pages: authenticated users cannot open standard Salesforce pages through that site even if their access controls otherwise allow them. Separately, disabling enableAuraRequests prevents guest users from loading Lightning-only features.
portal associates a portal for login access. The Chatter Answers password-recovery, help, and login selectors require Chatter Answers to be enabled: chatterAnswersForgotPasswordConfirmPage, chatterAnswersForgotPasswordPage, chatterAnswersHelpPage, and chatterAnswersLoginPage. forgotPasswordPage applies specifically to Experience Cloud sites; its presence in the structure does not make it a general Salesforce Sites password-reset setting.
Guest identity and record ownership. guestProfile is a read-only reference to the profile associated with the guest user, not an editable permission definition inside CustomSite. siteAdmin identifies the administrator by username. siteGuestRecordDefaultOwner separately identifies, by username, the owner of all new records created by unauthenticated guest users. It does not describe existing record ownership or identify the site administrator.
Custom-domain routing. redirectToCustomDomain applies to system-managed URLs ending in *.my.salesforce-sites.com or *.my.site.com. When enabled, Salesforce selects the destination as follows:
- Use the primary custom URL if it is an HTTPS custom domain.
- Otherwise, use the first associated HTTPS custom domain in alphanumeric order.
- If no HTTPS custom domain serves the site, the setting has no effect.
Within customWebAddresses, domainName identifies the domain and primary marks whether it is primary. The nested certificate identifies the certificate to use when Salesforce serves HTTPS for that custom domain.
urlPathPrefix is the distinguishing first part of the site's URL path, not its metadata name or display label. subdomain is also not a writable destination-domain setting. It is a read-only value representing the previous custom subdomain. It applies under MyDomainSettings.myDomainSuffix values MySalesforceLimited, CloudforceLimited, or DatabaseLimited. It returns the previous subdomain when Salesforce Sites or Digital Experiences was enabled under one of those suffix settings; otherwise, it returns null.
Each siteRedirectMappings entry has an independent activation state. Its source must be relative, while target can be relative or fully qualified with an http:// or https:// prefix. The rule's action determines whether the redirect is Permanent or Temporary.
Framing and browser protections. Clickjacking means placing a page inside another page's frame to mislead users into interacting with it. clickjackProtectionLevel defines the framing policy:
-
AllowAllFramingpermits framing by any page and provides no clickjack protection. -
Externalpermits framing on external domains. -
SameOriginOnlypermits framing only by the same origin and is the recommended setting. -
NoFramingdisallows framing by any page.
siteIframeWhiteListUrls records external domains allowed to frame the site. Its nested url accepts formats such as example, example.com, *example.com, and https://example.com. These trusted framing domains are separate from the domains that serve the site in customWebAddresses.
browserXssProtection enables protection against reflected cross-site scripting, an attack that sends malicious script through a request and reflects it into a response. Detection can cause the browser to show a blank page, which matters when diagnosing an apparently empty response. contentSniffingProtection prevents the browser from inferring a MIME type, or content format, from the response body and helps prevent some malicious files from executing as dynamic content. referrerPolicyOriginWhenCrossOrigin reduces disclosure of full URLs through referrer headers, including sensitive values that those URLs might contain.
Caching. With cachePublicVisualforcePagesInProxyServers=true, proxy caching of publicly available pages applies only to unauthenticated guest users. When it is false, cache-enabled Visualforce pages are cached in the browser for both authenticated and unauthenticated users. The switch is not a global cache-off setting.
Static resources. favoriteIcon names a static resource without its extension. The icon must be a 16-by-16-pixel ICO file at the site's base path; a specified icon missing from the required location returns a 404 response.
serverIsDown differs from inMaintenancePage: it is a static resource served from a cache server when Salesforce servers are down, rather than a Visualforce maintenance page. The resource must be a public ZIP file no larger than 1 MB and must contain maintenance.html at the ZIP root. Supporting images and styles can use other directory structures.
Deployment and Retrieval
In Metadata API format, CustomSite components reside in the sites directory, use the .site extension, and have filenames matching the site name. The type inherits fullName from Metadata. Do not substitute the user-interface masterLabel or the routing value urlPathPrefix for the component's identity. The type supports * as a member wildcard in package.xml.
Saving or deploying replaces all root custom URLs. customWebAddresses is replacement configuration, not an additive patch. All root custom URLs associated with the site are replaced by the entries in the collection. Omitting a root custom URL from the replacement list removes it from that set. Custom URLs with non-root path prefixes are neither included in this collection nor affected by this replacement.
The Visualforce page selectors are references to ApexPage components. A page name that looks like a Salesforce-provided default can still be an unresolved dependency in the destination. In a reported migration, the accepted solution was to include the referenced page and its controller in the API deployment rather than assume that site creation through the user interface and API deployment provision the same supporting components.
favoriteIcon and serverIsDown reference StaticResource components. Custom-domain HTTPS configuration can also reference Certificate metadata through customWebAddresses.certificate. Retrieving guestProfile exposes a read-only profile reference, not an embedded guest-permission definition.
For an Experience Cloud migration, CustomSite alone does not represent the complete site. Its Network and other site components remain separate metadata. Username resolution also matters in cross-org migrations: siteAdmin and siteGuestRecordDefaultOwner contain usernames, while other components in the migration can contain their own user references. A reported username failure must be traced to the component supplying it rather than assumed to originate in one particular CustomSite field.
Relationships
The site's outgoing references select Visualforce pages, resources, a certificate, a portal, and the guest profile. Incoming references connect it to Experience Cloud, navigation, embedded service, chat, and guest-sharing configuration. Guest-sharing references make the site identity relevant to data-access impact analysis; they are not outgoing user references from CustomSite.
References
-
ApexPage:authorizationRequiredPage,bandwidthExceededPage,changePasswordPage,chatterAnswersForgotPasswordConfirmPage,chatterAnswersForgotPasswordPage,chatterAnswersHelpPage,chatterAnswersLoginPage,chatterAnswersRegistrationPage,fileNotFoundPage,forgotPasswordPage,genericErrorPage,inMaintenancePage,inactiveIndexPage,indexPage,myProfilePage,robotsTxtPage,selfRegPage,siteTemplate. -
Certificate:certificate, nested incustomWebAddresses. -
Portal:portal. -
Profile:guestProfile, a read-only reference. -
StaticResource:favoriteIcon,serverIsDown.
Referenced By
-
Audience:container. -
Community:site. -
EmbeddedServiceConfig:site. -
EmbeddedServiceMenuSettings:site. -
LiveChatButton:site. -
LiveChatDeployment:site. -
NavigationMenu:container. -
Network:site. -
SharingRules:guestUserin guest-sharing entries. -
SharingGuestRule:guestUser; these entries occur within sharing-rule configuration.
Documentation Inconsistencies
The official field table names the framing-domain collection siteIframeWhiteListUrls, but the XML sample uses the singular siteIframeWhiteListUrl. The exposed collection name is siteIframeWhiteListUrls; the sample's singular wrapper is inconsistent with the field definition.
Reported Issues
-
A default-looking home-page name can block deployment. In an April 2024 Experience Cloud migration, a
CustomSitewhoseindexPagewasCommunitiesLandingfailed because the destination had no matchingApexPage. The reporter observed that creating a site through the UI generated default pages. The accepted answer advised deploying the referenced Visualforce page and its controller through the API instead of relying on that UI provisioning behavior. CommunitiesLanding deployment discussion. -
Unmatched usernames can block a cross-org site migration. In a 2019 migration containing
CustomSite,Network, andSiteDotCom, the reporter resolved deployment failures by reconciling usernames in the destination. The report did not isolate which component supplied each username, so it supports checking destination-user resolution rather than attributing every failure to a particularCustomSitefield. Community migration username discussion.
Common Questions
Is CustomSite enough to deploy an Experience Cloud site?
No. Experience Cloud uses Network, which can reference CustomSite. The site's other metadata remains separate; CustomSite alone is not its complete definition.
Why does deployment say no ApexPage named CommunitiesLanding exists?
indexPage references an actual Visualforce page. A reported migration failed because that page did not exist in the destination, even though UI site creation generated it. The accepted solution was to include the referenced page and its controller in the API deployment rather than assume they would be provisioned.
Does customWebAddresses add URLs or replace existing URLs?
It replaces all root custom URLs associated with the site when CustomSite is saved or deployed. Custom URLs with non-root path prefixes are not included in the collection and are not affected by that replacement.
Can I change guest-user permissions through guestProfile?
No. guestProfile is a read-only reference to the guest user's profile, not an editable permission definition. siteGuestRecordDefaultOwner is a separate setting for ownership of new guest-created records, not guest permissions.
Does disabling cachePublicVisualforcePagesInProxyServers turn off caching?
No. When it is false, cache-enabled Visualforce pages are cached in the browser for both authenticated and unauthenticated users. The setting controls proxy caching behavior, not all caching.