Open source Magento 2 module
SEO toolkit for Magento 2 and Luma
A standard Magento store has no canonical tags, lets filters and the cart be indexed and has no structured data or hreflang. Seven modules fix that in Magento's own Luma frontend – without moving to Hyvä.
Softcode SEO Toolkit · v0.5 · MIT
For you if you…
- run Magento 2 with Luma or a theme based on Luma/Blank
- have duplicates from filters and sorting in Google
- have store views in several languages
- want faster mobile pages without moving to Hyvä
What the modules fix
- No canonical tags by default, so filters and sorting create duplicates
- Filters, search, cart, checkout and 404 are all INDEX,FOLLOW
- No JSON-LD, no meta description outside the product page and no sitemap until someone creates one
- Store views in other languages look like duplicates, because there is no hreflang
- The largest image is fetched late on mobile, and third-party scripts block the page
- The checkout jumps around while Magento builds the form
Features
Faster LCP
Mobile LCP on the home page fell from 5.1 to 2.6 seconds in A/B runs, and listing pages and the cart got faster too.
Third-party scripts after consent
Tracking waits for consent (Magento, Cookiebot, CookieYes, OneTrust), chat for the first interaction. Mobile blocking time on the home page fell from 732 to 151 ms.
A calm checkout
The checkout appears once the form is finished: layout shift (CLS) from 0.235 to 0.012 on mobile. Works with Magento's CSP on checkout.
Canonical
Self-referencing canonical on every page, page 2 onwards included. Product URLs with a category path send a 301.
Robots
NOINDEX on filters, sorting, search, cart, checkout, account and 404, a robots.txt with sensible rules and an /llms.txt.
Hreflang
Hreflang between store views on the home page, CMS pages, categories and products – only for pages that exist in that language.
Structured data
JSON-LD for Product, BreadcrumbList, Organization and WebSite with a search box. Luma's microdata is removed.
Meta descriptions
A meta description on the home page, CMS pages and categories when nobody wrote one. What is filled in in the admin wins.
Sitemap
One sitemap per store view, daily generation and a Sitemap line in robots.txt.
Measured, not promised
Every fix is measured on a Magento 2.4.6 store with Luma sample data, with interleaved A/B runs so noise hits both sides. With all modules on, Lighthouse gives 100 for SEO, best practices and accessibility on the home, category, product and CMS pages. The scripts and raw data are in the repo. The modules are early versions, so try them on staging first.
Requirements
- Magento
- 2.4.6+
- PHP
- 8.1 – 8.3
- Licence
- MIT
Installation
Copy the modules you want into app/code (they are not on Packagist yet). Each module works on its own:
git clone https://github.com/DritonCa/magento2-seo-toolkit.git mkdir -p app/code/Softcode cp -r magento2-seo-toolkit/modules/* app/code/Softcode/ bin/magento module:enable Softcode_LumaSpeed Softcode_Canonical Softcode_Robots Softcode_StructuredData Softcode_Sitemap Softcode_Meta Softcode_Hreflang bin/magento setup:upgrade bin/magento setup:di:compile bin/magento setup:static-content:deploy -f bin/magento cache:flush
Questions about the module
Can we use just one module?
Yes. Each module works on its own, so you install only the ones you need.
Does it overwrite our own SEO settings?
No. Canonical and Robots switch on or fill in Magento's own mechanisms, and what is saved in the admin still wins.
What about cookie consent?
Tracking scripts can wait for consent from Magento's cookie restriction mode, Cookiebot, CookieYes or OneTrust. The lists are empty until you fill them in in the admin.
Does it work with Hyvä?
The toolkit is built and tested for Luma and themes based on Luma/Blank. Hyvä is not tested.
Does your Magento shop need its SEO and speed sorted?
Questions about the module, or need it adapted to your shop? We are happy to install and adapt it.