Indexing
Optimizing Adobe Commerce storefronts on Edge Delivery Services for search engines requires guidance. The general recommendations provided here are inspired by customers and partners who have built storefront projects on Edge Delivery Services.
The following best practices are designed to help you ensure that your site is indexed correctly by search engines.
Canonical URLs
- When product detail pages (PDPs) have multiple URLs, set a consistent canonical URL for each product.
- Make sure that canonical URLs do not point to redirects (301).
Configurable products
For configurable products, ensure that the canonical URL is set to the parent product URL. This is important because Google might index the child product URLs, which can lead to duplicate content issues.
Folder mapping
When using folder mapping for Commerce pages (PDP, PLP) ensure that the server-side rendered response contains metadata that allows Google to differentiate pages.
Folder-mapped pages (without using bulk metadata) all look the same and Google might classify them as duplicate and not index them, despite different canonical URLs as Google considers canonical URLs a hint and not an absolute value.
URL format of catalog pages
By default, the boilerplate uses folder mapping for product detail pages (PDP) and dedicated pages for product list pages (PLP). If your catalog has a large amount of PLPs, it might make sense to also use folder mapping for PLPs. A low number of PDPs or PLPs could justify creating dedicated pages for each.
The URL format for folder mapped PDPs looks like this:
/products/{urlKey}/{sku}
This is to include the SEO relevant urlKey
parameter and the SKU
which is needed to perform Catalog Service queries. Feel free to customize the format as needed. You might need to do advanced customization on the CDN.
Multi-store setups
For multi-store setups or stores supporting multiple locales:
Verify a correct hreflang setup. You can validate using the hreflang Tags Testing Tool
Verify that the
Magento-Store-Code
header value defined in your storefront configuration is part of the URL for every Catalog Service or Live Search request.
Cache-busting query parameter
The Commerce boilerplate template provides a reference implementation that you can use to add a cache-busting query parameter to the Catalog Service endpoint:
This function sets the Catalog Service endpoint with a cache-busting query parameter based on the Magento-Store-Code
header value. The PDP drop-in component uses this function at initialization.
...export async function commerceEndpointWithQueryParams() { const urlWithQueryParams = new URL(getConfigValue('commerce-endpoint')); // Set some query parameters for use as a cache-buster. No other purpose. urlWithQueryParams.searchParams.append('ac-storecode', getConfigValue('headers.cs.Magento-Store-Code')); return urlWithQueryParams;}...
This function calls the commerceEndpointWithQueryParams
function at PDP drop-in component initialization.
...await initializeDropin(async () => { // Set Fetch Endpoint (Service) setEndpoint(await commerceEndpointWithQueryParams());});...
Redirects
Ensure proper redirects are set up using the redirects sheet or through your CDN.
- Fallbacks for any potential URL changes (for example, product URLs or missing .html suffixes)
- Redirects that are set up in Adobe Commerce
Sitemaps
- Submit new sitemaps through Google Search Console (Google takes a while to detect new sitemaps).
- If your site is using more than one sitemap, reference all sitemaps in your site’s
robots.txt
file. - Ensure that all sitemaps are valid using the hreflang Tags Testing Tool.
Other
- You can validate indexing using Google Search Console by inspecting the markup of the crawl to see if all important information were tracked.
- Transactional pages (for example, cart, checkout, and account) should not be indexed.
- Staging or any non-production environments must not be indexed. Once indexed, URLs from a staging environment can reduce traffic to the production environment. It might take a significant amount of time to remove staging URLs from the Google index.