Search by

akawaka / sylius-seo-plugin

akawaka

SEO for Sylius 2: meta tags, canonical, hreflang, Open Graph and Twitter cards with per-entity overrides and templates

Package info

github.com/akawaka/SyliusSEOPlugin

Type:sylius-plugin

pkg:composer/akawaka/sylius-seo-plugin

Statistics

Installs: 1

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 1

v0.1.0 2026-10-30 17:12 UTC

This package is not auto-updated.

Last update: 2026-10-31 15:25:35 UTC


README

AKAWAKA

AKAWAKA is a software development company specializing in e-commerce platforms and custom web applications. We help businesses evolve or rebuild their platforms with a pragmatic approach: improving existing solutions or starting from scratch, notably with Sylius. Our team also handles data migration, SEO preservation, and business continuity. With strong expertise in PHP and Symfony, Akawaka builds web solutions tailored to our clients’ business needs.

Akawaka Sylius SEO Plugin

Meta tags, canonical, hreflang, Open Graph and Twitter cards for Sylius 2.x, with per-entity overrides and configurable default templates.

Features

  • Meta title and description per product and taxon, translated per locale, edited in an SEO tab of the admin forms with a search result (SERP) preview and character counters.
  • Default templates per subject type ({name} | {channel}), used whenever a field is empty; the description is stripped of HTML and truncated.
  • Canonical URL (current URL by default, overridable) and robots (index/noindex, follow/nofollow).
  • hreflang alternates for every locale enabled in the channel.
  • Open Graph and Twitter cards, with the first product image as default picture.
  • JSON-LD structured data: Organization, BreadcrumbList, Product with Offer / AggregateOffer and AggregateRating.
  • XML sitemap (/sitemap.xml): paginated product and taxon sections with hreflang alternates and images; noindex pages are left out.
  • robots.txt per channel (/robots.txt), editable in the channel form, with a default content and an automatic Sitemap: line.
  • Redirections 301/302 managed in SEO → Redirections, applied when a URL answers 404, with hit counters. A 301 is created automatically when the slug of a product or taxon changes (existing chains are collapsed).
  • SEO audit (SEO → SEO audit): missing, too short or too long titles and descriptions, duplicated titles, noindex pages, products without image, per channel and locale. Product and taxon images lacking an alt text are listed one by one with an input and a button suggesting the name of the product or taxon. Titles, descriptions and noindex issues of products and taxons are editable in place too (a character counter shows the recommended length), and the Save button of the header writes every edited field. Alt texts are applied to the storefront <img> tags whatever the theme, by matching the image file, so no Sylius template is overridden.
  • Akawaka CMS plugin integration (optional, see CMS pages).
  • Rendered automatically in the <head> of the Sylius shop through a twig hook. Translations: English and French.

Requirements

  • PHP 8.2+
  • Sylius 2.0+

Installation

Add the Akawaka Flex recipes endpoint to your project, then require the plugin:

composer config --json extra.symfony.endpoint '["https://api.github.com/repos/akawaka/symfony-recipes/contents/index.json?ref=flex/main","flex://defaults"]'
composer require akawaka/sylius-seo-plugin

Symfony Flex registers the bundle and creates config/packages/akawaka_seo.yaml and config/routes/akawaka_seo.yaml (see Manual installation for their content).

If public/robots.txt or public/sitemap.xml exist, the web server serves them instead of the plugin: remove them.

Then update the database:

bin/console doctrine:migrations:migrate

Manual installation (without Flex)

Replace the first step above with:

composer require akawaka/sylius-seo-plugin

Register the bundle and import the configuration:

// config/bundles.php
return [
    // ...
    Akawaka\SyliusSEOPlugin\AkawakaSyliusSEOPlugin::class => ['all' => true],
];
# config/packages/akawaka_seo.yaml
imports:
    - { resource: '@AkawakaSyliusSEOPlugin/config/config.yaml' }
# config/routes/akawaka_seo.yaml
akawaka_seo_admin:
    resource: '@AkawakaSyliusSEOPlugin/config/routes/admin.yaml'

akawaka_seo_shop:
    resource: '@AkawakaSyliusSEOPlugin/config/routes/shop.yaml'

Configuration

# config/packages/akawaka_seo.yaml
akawaka_sylius_seo:
    description_max_length: 160
    sitemap:
        page_size: 5000   # URLs per sitemap section (max 50000)
    subjects:
        product:
            class: Sylius\Component\Core\Model\ProductInterface
            title_template: '{name} | {channel}'
            description_template: '{description}'
        taxon:
            class: Sylius\Component\Core\Model\TaxonInterface
            title_template: '{name} | {channel}'
            description_template: '{description}'

Available placeholders: {name}, {description}, {channel} and any property of the entity through {subject.code}; unknown placeholders render empty.

CMS pages

If the Akawaka Sylius CMS plugin is installed, this plugin covers its pages too. Nothing is required: the integration is enabled when the CMS bundle is registered, and the SEO plugin never depends on it.

  • the published pages are listed in the sitemap (/sitemap-page-N.xml) with their hreflang alternates;
  • the audit checks their meta title and description (the CMS fields) and links to the CMS page editor;
  • changing the slug of a page creates a 301 redirect;
  • Organization and BreadcrumbList JSON-LD are added to the page.

The SEO fields of a page (meta title, description, Open Graph image) stay edited in the CMS plugin, which also prints the meta tags, canonical and hreflang of its pages: this plugin does not duplicate them.

Theming

The tags are rendered by templates/shop/head.html.twig. Override it in your application:

templates/bundles/AkawakaSyliusSEOPlugin/shop/head.html.twig

Development

make init            # start the containers (PHP, MySQL, nginx, mailhog) and install dependencies
make database-init   # create the test application database, run migrations and load the Sylius fixtures
make frontend        # build the assets of the test application (only to browse it)
make test            # ECS, PHPStan (level max), PHPUnit

Project run at http://plugin.localhost

Project conventions are listed in AGENTS.md.

License

MIT.