Magento SEO: the technical guide for Magento 2 stores

Magento SEO technical guide
The Magento settings and server checks that decide whether your store can rank: crawl control, sitemaps for the right store view, hreflang, full-page cache, structured data and bot rules, with real examples from our own audit.

Magento SEO comes down to three jobs: control what Google can crawl, make sure every page that should rank is fast and indexable, and stop upgrades and server changes from silently undoing that work. Most Magento stores lose rankings to technical problems, not to weak content. Layered navigation floods Google with near-duplicate URLs, store views multiply one canonical mistake across every market, and a single uncacheable block can make a whole page slow.

This guide walks through each area with the Magento setting or the command to check it. Several examples come from an audit we ran on our own site, shopwhizzy.com, because the problems we found there are the same ones we find on client stores.

Want the short version? Jump to the checklist at the end, or ask us for a Magento SEO review.

Why Magento needs its own SEO approach

Generic SEO advice assumes a site with a few hundred pages and one language. A Magento store is different in four ways:

  • Layered navigation turns every filter combination into a crawlable URL. A category with ten filters can produce thousands of variations.
  • Store views mean one configuration mistake repeats in every language and country.
  • Speed is decided on the server: full-page cache, Varnish, Valkey or Redis, PHP and the frontend theme matter more than any SEO extension.
  • Upgrades and new extensions change output: URL keys, canonical tags, structured data and robots tags can change without anyone noticing.

1. Control what Google crawls

Canonical tags on categories and products

Magento can add canonical tags itself. Go to Stores > Configuration > Catalog > Catalog > Search Engine Optimization and set both Use Canonical Link Meta Tag For Categories and Use Canonical Link Meta Tag For Products to Yes.

In the same section, set Use Categories Path for Product URLs to No. When it is on, a product in three categories is reachable at three URLs, and Google has to guess which one counts.

Layered navigation

Decide which filter pages deserve to rank. A filter like brand or colour on a big category can be a real landing page with search demand. Most combinations, such as price ranges, sort orders and three filters at once, are not. The usual pattern:

  • Filters with demand get their own indexable landing pages with a unique title and description.
  • Everything else gets noindex, follow and a canonical tag pointing to the clean category URL.
  • Sort, limit and mode parameters are blocked in robots.txt, so crawlers do not waste time on them.

robots.txt

Edit it in Content > Design > Configuration > (your store view) > Search Engine Robots. Block the cart, checkout, customer account, internal search and sorting parameters. Never block CSS or JavaScript; Google needs them to render your pages.

2. Get the sitemap right, for the right store

Magento generates sitemaps in Marketing > SEO & Search > Site Map. Two problems come up again and again.

The sitemap belongs to the wrong store view. Each sitemap record is tied to a store. If your store was migrated or restructured, it can still point at an old one. That is exactly what we found on shopwhizzy.com: the sitemap was being generated for a legacy website, so our theme product pages had never been in it, while an orphan category that returned 404 was.

The sitemap lists pages that should not rank. Magento includes every visible product. If you sell services, subscriptions or test products as Magento products, their purchase pages end up in the sitemap. Keep only real landing pages in it, and mark the rest noindex, follow.

Check yours by opening /sitemap.xml and asking two questions: are all my important pages here, and is anything here that should not be?

3. International stores: store views and hreflang

Each language or country should have its own store view with translated URL keys, titles and meta descriptions. Magento does not output hreflang tags on its own, so you need an extension or a small custom module. The rules that matter:

  • Every page lists all its language versions, including itself.
  • The URLs in hreflang tags are canonical, indexable and return 200.
  • Add an x-default for visitors who match none of your markets.

4. Speed and Core Web Vitals start on the server

Run in production mode. Developer mode compiles code on the fly and is far slower. Check with bin/magento deploy:mode:show. Our own site was still in developer mode when we started this audit.

Make sure pages are actually cached. A single block declared cacheable="false" in a layout file makes the whole page uncacheable. On shopwhizzy.com, a pricing block on nine hosting pages had that flag although it showed no customer-specific data. Those pages answered in 480 to 660 ms, while cached pages answered in 130 to 230 ms. Find these blocks with:

grep -rn 'cacheable="false"' app/code app/design

Then the frontend: a Hyvä theme ships a fraction of Luma's JavaScript, which is usually the single biggest improvement for Largest Contentful Paint and Interaction to Next Paint. See Hyvä theme development and migration.

5. Structured data

Product pages should output Product with an Offer (price, currency, availability) and BreadcrumbList. The home page should output Organization with a sameAs list of your official profiles, so search engines and AI assistants connect your brand across sites. Test every template in Google's Rich Results Test.

Be realistic about FAQ markup: since August 2023, Google shows FAQ rich results only for well-known government and health sites. It does no harm, but it will not win you extra space in results.

6. Check that Google's tools and AI crawlers can actually reach you

Server-level bot blocking is common on Magento hosting, and it can quietly block the wrong visitors. On our own server, one site's nginx rule was shared by every site through a common variable name. It blocked Google-InspectionTool, the agent behind Search Console's URL Inspection and the Rich Results Test. It also blocked ClaudeBot, ChatGPT-User and PerplexityBot, which means fewer mentions in AI answers. Normal Googlebot still worked, so rankings looked fine and nobody noticed.

Test it yourself:

curl -s -o /dev/null -w '%{http_code}\n' -A 'Mozilla/5.0 (compatible; Google-InspectionTool/1.0)' https://yourstore.com/
curl -s -o /dev/null -w '%{http_code}\n' -A 'Mozilla/5.0 (compatible; ClaudeBot/1.0)' https://yourstore.com/

Both should return 200, unless you decided to block AI crawlers on purpose.

7. Protect rankings through upgrades and migrations

  • Crawl the store before the upgrade and save the list of URLs, titles, canonicals and status codes.
  • Crawl staging after the upgrade and compare.
  • After launch, regenerate the sitemap, check robots.txt, and watch Search Console coverage for two weeks.

More on that in our Magento upgrade service.

Magento SEO checklist

AreaCheckWhere
CanonicalsCanonical tags on for categories and productsCatalog > Search Engine Optimization
URLsCategory path in product URLs offCatalog > Search Engine Optimization
Layered navigationOnly filters with demand are indexableTheme or SEO extension
robots.txtCart, checkout, search and sorting blocked; CSS and JS allowedContent > Design > Configuration
SitemapGenerated for the live store view; landing pages onlyMarketing > Site Map
HreflangAll versions listed, self-reference, x-defaultExtension or custom module
ModeProduction modebin/magento deploy:mode:show
CacheNo cacheable="false" blocks on landing pagesgrep in app/code and app/design
Structured dataProduct, Offer, BreadcrumbList, OrganizationRich Results Test
BotsGoogle-InspectionTool and chosen AI crawlers get 200curl -A

Frequently asked questions

Do I need an SEO extension for Magento?

Not always. Magento's built-in settings cover canonical tags, URL structure, robots.txt and sitemaps. An extension helps with layered navigation rules, hreflang, templated meta tags and richer structured data on large catalogs.

How long until Magento SEO fixes show results?

Technical fixes usually show within four to eight weeks, once Google has recrawled the affected pages. New content and new landing pages take longer, typically three to six months.

Is Hyvä better for SEO than Luma?

Hyvä does not change your URLs or content, but its much lighter frontend usually improves Core Web Vitals, which helps both rankings and conversion.

Should I block AI crawlers?

That is a business decision. If you want your store mentioned and linked in ChatGPT, Claude or Perplexity answers, let their crawlers in. Either way, make it a deliberate choice, not a side effect of a shared server rule.

Need a hand? We run SEO for Magento stores and fix what we find in the code and on the server. See our Magento SEO services.