When it comes to e-commerce platforms, there are few that are more robust than Magento. Due to its power and customizability, Magento is still the go-to e-commerce platform for retailers. This is especially true for enterprise stores. Magento is utilized by many enterprise sites such as American Express, Ford, Puma, Xerox, and more.
In 2019, it was estimated that Magento accounted for 30% of the e-commerce market share. Using BuiltWith data, we can see that 1.04% of the top 1 million sites utilize the platform, and Magentoโs share of the market grows to 1.77% in the top 10,000 sites.
If youโre an SEO working in the e-commerce space, itโs going to be important to learn how to work with Magento. Fortunately, there are a lot of really good things that Magento does out of the box from an SEO perspective. However, there are definitely some considerations youโll need to take into account with any Magento site.
What is Magento SEO?
Magento SEO is a set of SEO adjustments that are unique to the Magento platform. Magento has great features for SEO such as a robots.txt file, sitemap.xml and multiple ways to redirect pages. Magento SEO issues include duplicate content from the faceted navigation, improper canonical tags, and a lack of blogging functionality.
Below you can see our recommendations for improving SEO on the Magento platform:
1. Crawling & indexing
Duplicate content & faceted navigation
One of the biggest SEO issues with any Magento site is likely going to be the faceted navigation. Faceted navigations create huge crawling and indexing issues since their existence exponentially increases the number of pages that can be crawled. As pages in the faceted navigation will only either sort or narrow existing products, these pages create duplicate and similar content. Alsol, if you think about the fact that every single combination of parameters could be considered a unique page, the number of pages a faceted navigation creates can be enormous. In this example, Google showsa video from Google, they indicate how a store with 158 SKUs actually created 380,000 unique URLs that Googlebot could crawl. Not ideal!
If your Magento store utilizes faceted navigation, youโre likely going to need to take steps to control the crawl. While a how-to on controlling the crawl of a faceted navigation could warrant multiple blog posts, Iโll try to summarize steps that should be taken.
-
Audit to find low-quality, indexed pages from the faceted navigation. Identify steps to remove them from the index (noindex, canonical tag)
-
Review the siteโs log files to find any low-quality pages that are getting crawled
-
Block the crawl of any low value parameters through the robots.txt
-
Consider only allowing pages with high search potential to be indexed
Of course, the steps taken here are going to vary a lot depending on the site. The overall point is that if you utilize a faceted navigation on your Magento site, one of the most important things youโll need to do is review how Google is crawling and indexing the pages that are being generated and take steps to remove the indexation and then block the crawl of low quality or duplicate pages.
Product & category page canonical tags
By default, a Magento siteโs canonical tags wonโt be set for both product and category pages. This isnโt ideal, as itโs best practice to ensure that product and category pages have self-referential canonical tags. This indicates to the search engines that these pages are the pages that should be ranking well.
Fortunately, you can adjust this in vanilla Magento:
-
Navigate to Stores > Configuration
-
In the โCatalogโ dropdown, select โCatalogโ
-
Select the โSearch Engine Optimizationโ dropdown
-
Ensure that โUse Canonical Link Meta Tag For Categoriesโ and โUse Canonical Link Meta Tag For Productsโ are set to โYesโ
-
Select โSave Configโ
By adjusting these settings, this should ensure that all of the siteโs product and category pages will have self-referential canonical tags applied to them.
Canonical tags in pagination
When looking at paginated URLs of Magento sites, we can see that, by default, proper canonical tags are not set. In Magento, all of the paginated URLs in a given series have a canonical tag that points back to the root category page. For example, here is how the canonical tag of โPage 2โ of a particular category would look:
URL: www.example.com/category?p=2
Canonical Tag: www.example.com/category
Technically, this is not best practice from an SEO standpoint. Canonical tags should only be used to consolidate duplicate content. Since paginated content are not duplicates of the root versions (as they contain different products), they should not have canonical tags that point to this version. Instead, every page within the pagination series should have itโs own self-referential canonical tag. This will tell Google that the paginated URL contains unique content and should be crawled accordingly.
URL: www.example.com/category?p=2
Canonical Tag: www.example.com/category?p=2
You might need to have a developer create a custom solution that allows the siteโs pagination to utilize self-referential canonical tags instead of pointing to the root category page.
Indexable internal search pages
Another Magento SEO issue is that internal search pages are indexable out of the box. This means that Google can crawl and index these low-quality pages. These pages will generally be in the /catalogsearch/ URL path.
For example, hereโs a Magento site where over 4,000 internal search pages have gotten caught in Googleโs index:
In order to ensure that these pages donโt get indexed by Google, youโll want to be sure the โnoindexโ tag is applied to them. We recommend having a developer implement this for you and providing this article as a reference point for them.
After youโve implemented the โnoindexโ tag, youโll want to be sure that none of your internal search URLs are actually getting indexed. Perform a search for โsite:example.com inurl:/catalogsearch/โ. If you see URLs appearing in the index, we recommend waiting until Google removes the majority of them. If you donโt see the URLs in the index, you might consider blocking them by using a robots.txt command.
Robots.txt
Within Magento, you can also configure the robots.txt file. Youโll want to utilize the robots.txt file in order to limit how many pages of your Magento site that Google is eligible to crawl. This is especially important to configure if your site utilizes a faceted navigation that allows users to select from a variety of attributes.
Fortunately, Magento does allow you to control the robots.txt of your site. To do this, you can perform the following steps:
-
In the Admin sidebar, navigate to Content > Design > Configuration
-
Find the โStore Viewโ you want to adjust and select โEditโ
-
Expand the โSearch Engine Robotsโ dropdown
-
Add your robots.txt commands in the โEdit custom instruction of robots.txt Fileโ field
How you adjust the robots.txt is going to depend on your particular store. Unfortunately, there is no one-size-fits-all option here. The main objective will be to block the crawling of any low value pages (that arenโt indexed) while allowing the crawl of high priority ones.
Below are some general things you might consider blocking in the robots.txt:
-
Low value pages created by the faceted navigation and sorting options
-
The siteโs internal search pages
-
Login pages
-
The userโs shopping cart
Sitemap.xml
Sitemap.xml files ensure that Google has a pathway of discovering all of your siteโs key URLs. This means that regardless of the siteโs architecture, the sitemap.xml gives Google a way of finding important URLs on the site.
Fortunately, Magento has the capability of creating a sitemap.xml file and does a good job of this in itโs default settings. You can technically configure the XML sitemap settings in Magentoโs โCatalogโ menu. However, most of these should be okay.
While these settings are configured, you might need to generate your sitemap.xml file so it will actually be published on the site. Fortunately, that process is very straightforward. You can do this by:
-
Navigating to Marketing > SEO & Search > Site Map
-
Click the โAdd Sitemapโ button
-
For โFilenameโ add the text โsitemap.xmlโ
-
For โPathโ, choose the URL path you want to be associated with your sitemap.xml file. This is generally at the โ/pub/โ URL path
-
Click โSave & Generateโ
This should correctly set up your sitemap.xml on Magento. Youโll then want to be sure to submit your sitemap.xml file to Google Search Console so Google can discover your sitemap.xml file.
2. JavaScript rendering
Something else that youโll want to be mindful of on Magento sites is any content that is loaded through JavaScript. Magento frequently utilizes JavaScript to load key content on the store. While this isnโt inherently a negative thing for SEO, it is something youโll want to be sure youโre reviewing.
If JavaScript is required to load key content on a page, this means that Google must perform a two-step indexing process where it processes the initial HTML, and then must return to the site to render any content loaded via JavaScript. Where SEOs need to check is in the second stage of the indexing process, to ensure that Google was able to โseeโ all of the content that is on the page. If any elements are loaded via JavaScript, itโs worth checking whether theyโre indexed.
For instance, hereโs an example of a product page in Magento where JavaScript is enabled in the browser. We can see thumbnail images, text in tabs, and a related products section at the bottom:
However, most of that content is reliant on JavaScript to load. When turning JavaScript off using the Web Developer extension for Chrome, most of those elements do not render. Notice how we can only see the initial three tabs on the page:
Since JavaScript is required to load a lot of the content on the page, weโll want to ensure that itโs getting indexed properly. Fortunately, we can use tools such as The Mobile Friendly Testing Tool and The Rich Results Test to determine what Googlebot is able to render on the page.
We also like to manually check the index by identifying content thatโs loaded via JavaScript, and then using a โsite:โ search operator to verify that Google is able to read that text on the page. JavaScript SEO is a very expansive subject and I suggest reading this guide by Pierce Brelinsky for more information. Just understand that if you use Magento, some of your content is likely loaded through JavaScript.
3. URL paths
Out of the box, Magento will add the URL extension โ.htmlโ to the end of the siteโs product and category URLs. While this isnโt necessarily โbadโ for SEO, it does create lengthier URLs that are harder to read from a user perspective. URLs without the โ.htmlโ extension will have a much cleaner format for users.
To remove the .html extension from the end of URLs, you can take the following steps:
-
Navigate to Stores > Configuration
-
In the โCatalogโ dropdown, select โCatalogโ
-
Select the โSearch Engine Optimizationโ dropdown
-
Find โProduct URL Suffixโ & โCategory URL Suffixโ
-
Replace the โ.htmlโ field with โ/โ
-
Select โSave Configโ
The result will be cleaner and easier to read URLs for your store.
Please note that this is best done for a brand new Magento site. This change will automatically adjust all of the URLs on your Magento store. If your store has already existed for some time, without proper migration planning, changing this field could actually result in ranking drops. Therefore, tores that have been established a while may want to consider keeping the โ.htmlโ extension.
In addition, the old URL paths wonโt automatically redirect back to the new URLs without the โ.htmlโ extension. This means that you might need to implement global redirect rules to ensure that the old pages will redirect both users and search engines.
4. Redirects
Global redirects
Magento does implement global redirects on your site. This means that if your store utilizes a โwwwโ subdomain or โhttpsโ, if a user doesnโt enter those attributes, Magento will still redirect the user to the correct destination URL. This is great for the user experience of the site, as users should land on the correct content even if they donโt type in the exact destination URL in those instances.
However, Magento does this through 302 redirects instead of 301 redirects:
Back in 2016, there was a famous study by Wayfair that showed that 302 redirects could significantly dilute link equity. While Google has claimed that 302 redirects pass link equity, this argument is still a never-ending debate in SEO. While we believe that 302 redirects do distribute much more link equity then they once did, we take the stance that you should never utilize 302 redirects unless you absolutely need to.
For this reason, we recommend adjusting this in the Magento platform. Fortunately, this is a very straightforward change:
-
Navigate to Stores > Configuration
-
In the โGeneralโ dropdown, select โWebโ
-
Select the โUrl Optionsโ dropdown
-
Change โAuto-redirect to Base URLโ to โYes (301 Moved Permanently)โ
This should ensure that your Magento websiteโs global redirects now utilize 301 status codes instead of 302:
Custom redirects
Of course, aside from the siteโs global redirects, youโre also going to want to implement 1:1 redirects for individual pages. This ensures that if you ever need to implement redirects for old pages, you can do so. Fortunately, Magento offers this functionality out of the box.
In order to implement redirects for individual pages, you can perform the following steps:
-
In the Admin sidebar, navigate to Marketing > SEO & Search > URL Rewrites
-
Select โAdd URL Rewriteโ
-
Enter the URL you wish to redirect in the โRequest Pathโ. This must be a relative URL
-
Enter the destination page in the โTarget Pathโ. This must be a relative URL
-
Choose the โRedirect Typeโ. Generally, youโll want to choose โPermanent (301)โ
-
Select โSaveโ
Please note that in order to implement redirects, the page must be completely deleted from Magento, as you canโt redirect active pages. This makes redirects very โall or nothingโ, as they need to be completely removed from the platform first.
Automatic redirects
One thing thatโs good to know about redirects in the Magento platform is that it will automatically create redirects when you change the URLs. For example, here Iโm changing the URL path of a page:
FROM: dash-digital-watch
TO: dash-digital-watches
We can see how there is an option to โCreate Permanent Redirect for old URLโ
This is a really nice feature that makes it easier to handle the siteโs redirects, and is definitely a best practice if you plan on changing URL paths for any key pages of the site.
5. On-page content
Title tags & meta descriptions
Want to set your title tags, meta descriptions, and URLs for an individual product? No worries, Magento includes this SEO feature by default.
When youโre on an individual product or category page, simply scroll down and find the โSearch Engine Optimizationโ dropdown. From there you can enter your title tag in the โMeta Titleโ field and your meta description in the โMeta Descriptionโ field.
Related products
Another great feature that Magento allows you to implement is โRelated Productsโ. You can set this on individual product pages. Adding โRelated Productsโ to all of the siteโs product pages is a fantastic way to improve several SEO aspects of your site:
-
This can help improve the overall UX and engagement by showing users other products that are similar to the one theyโre on
-
This can result in more revenue from showing users upsell opportunities
-
The internal links from these products can help Google easily discover and distribute link equity to them
On Magento product pages, you can manually set โRelated Productsโ for a particular product. To do this, navigate to the product and then find โRelated Products, Up-Sells, and Cross-Sellsโ. You can then select โAdd Related Productsโ and add any other SKUs you offer that users might be interested in. This should add these internal links to the bottom of your product page!
6. Blogging functionality
One of the biggest weaknesses of Magento from an SEO perspective is that the platform doesnโt contain blogging functionality out of the box. While generally an e-commerce siteโs category and product pages are going to be the most important from a revenue perspective, blogs can still be very important for e-commerce sites.
In recent years, there has definitely been a shift towards more informational content ranking for keywords where we would expect a category or product page to rank instead. We can see that, more and more, Google is choosing to rank content such as guides, affiliate sites, or โhow toโ content above product and category pages. This means that not having a place for informational content to live can limit Magento storesโ SEO success.
For instance, letโs say we set up a store that sells cameras that are great for selfies. Naturally, we might want to create a page to rank for the term โselfie camerasโ. However, when we check the SERPs, some of the top ranking results are informational pieces of content.
In the screenshot below, you can see how ShotKit (#2) and B&H (#3) actually rank above Best Buy and Amazon for this query with โBest Selfie Cameraโ pages:
When we look at the B&H page, we can see how theyโve set up a blog post that ranks the best selfie cameras that they offer. Theyโve then intelligently linked to the products in their store. Instead of trying to force a category or product page to rank, they were able to use this listicle-style blog post to improve their visibility for an important query:
A blog allows a natural place for your informational content to live. Without informational content, Magento stores might not be able to rank for some of their target keywords by only using product and category pages.
Fortunately, there are extensions that you can utilize such as the Magento 2 Blog Extension from Magefan. You could also consider setting up a blog on WordPress and creating a subdomain for your Magento store (blog.example.com). We highly recommend setting up one of these options to give your site the ability to host informational content.
7. Structured data
Structured data is code you can add to your site that gives Google a better understanding of what an individual page is about. As Magento sites can be quite large, structured data can be a great way to improve Googleโs understanding of the site at scale.
For e-commerce sites, here is our ideal mapping of which structured data types should go on different page templates:
-
Home Page: Organization
-
Category Page: CollectionPage, BreadcrumbList
-
Product Page: Product, BreadcrumbList
-
Blog: Article
This mapping can help give Google a stronger understanding of your storeโs content. Below is a little more detail about CollectionPage and Product structured data, as these will be included on the most important pages of your site.
CollectionPage
By using CollectionPage schema, you can signal to Google that your category pages contain a collection of different products, and provide key information about each one. Here are some of the properties you can include about each product:
-
Name
-
URL
-
Position on the page
For example, here is some CollectionPage structured data that weโve been able to implement:
Product
Of course, Product structured data is a staple of e-commerce sites. Product schema tells Google and other search engines that the page contains information about a particular SKU. Ideally, this structured data will contain key properties such as:
-
Name
-
Description
-
Image
-
Price
-
SKU
-
aggregateRating
One of our favorite properties to include both on-page and within the structured data is the โSKUโ property. Itโs very common on Magento sites to see queries for SKU numbers appearing in Search Consoleโs โPerformanceโ report. These are high-intent queries where users could be looking to purchase the exact product that youโre offering in your store. Youโll definitely want to be sure youโre including this in both the on-page content and Product schema markup.
Conclusion
Overall, the good news for Magento store owners is that the platform is built well for SEO. Since itโs open source, store owners have a lot of control over a particular siteโs SEO elements such as the robots.txt, sitemap.xml, redirects, metadata, and more. While there are a few SEO issues that store owners might run into, such as duplicate content through the faceted navigation and no blog functionality, Magento does give store owners and SEOs the tools they need in order to fix these issues.
If you have any other strategies that you use to improve the SEO on Magento sites, let us know on Twitter @moz andย @gofishchris.ย