SEO attributes
Purple Experience
Search Engine Optimization (SEO) is crucial to ensuring that your website ranks well in search engine results. To optimise a website effectively, certain basic SEO attributes must be set up correctly. These include metadata, content, technical aspects and crawling behaviour, especially for production and staging systems. This article provides a summary of the key SEO attributes to focus on.
Title tags (Set Page Titles) and meta descriptions are crucial for both search engine ranking and click-through rates.
The title tag should include relevant keywords and be concise (50-60 characters), while the meta description (around 150-160 characters) should summarise the content of the page and include a call-to-action.
In Purple, you'll usually configure what data to use on a view, where you will have views.json for any type of page on your website.
Header tags structure the content, making it easier for search engines and users to understand. The H1 tag should clearly state the main topic of the page, with H2 and H3 tags providing a hierarchy for sub-topics. Proper use of these tags improves content readability and SEO ranking.
H tags must be used in the correct order and there should not be more than one H1 tag on a page.
Search engines can't read images, so providing descriptive alt text helps them understand what an image represents. ALT text also improves accessibility and is crucial for ranking in image search results. An ALT tag must be present for every image, but it can be left blank for images that are purely decorative to improve the accessibility of the page.
If a page has multiple versions (such as when you have dynamic URLs or similar content), canonical tags tell search engines which version is the preferred one. This helps prevent duplicate content issues that could hurt your SEO.
To properly determine the canonical tag, you'll need to set up the routing accordingly. See Experience Routing for details.
With Google's mobile-first indexing, ensuring your website is mobile-friendly is paramount. Responsive design, fast loading times and usability across devices are all crucial to ranking well in mobile search results.
An XML Sitemap helps search engines to discover and index the pages of your website more effectively. A well-structured sitemap ensures that all important pages are indexed, while the robots.txt file is used to control how search engines crawl your site; for details on setting up robots.txt, see Set crawling behaviour.
Ensure that production systems allow search engines to crawl and index the site. This can be managed using the robots.txt file and meta tags such as index and follow. The production system should be accessible, with an emphasis on proper sitemaps and canonical URLs to guide search engines.
Staging environments should not be crawled by search engines, as this could lead to duplicate content issues and negatively impact SEO. To prevent this, use noindex meta tags, password protect the site and disallow crawling via the robots.txt file. Staging systems should be invisible to search engines to avoid indexing incomplete or test content.
Using structured data helps search engines understand the content better and can enhance your listings with rich snippets (such as reviews, prices, and more). Schema markup is particularly valuable for e-commerce, recipes, events and other specific content types.
See Configure JSON-LD for details.
Fast page load times and optimal performance scores such as Google's Core Web Vitals (which measure loading, interactivity and visual stability) are essential for SEO. Google rewards faster sites with higher rankings.