Download the PHP package mulertech/seo-bundle without Composer
On this page you can find all versions of the php package mulertech/seo-bundle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package seo-bundle
MulerTech SEO Bundle
Symfony bundle for SEO management: meta tags (OpenGraph, Twitter Cards), Schema.org JSON-LD structured data, sitemap XML generation, robots.txt, and llms.txt.
Requirements
- PHP 8.4+
- Symfony 6.4+, 7.0+ or 8.0+
Installation
Configuration
Usage
1. Implement SeoCompanyInfoProviderInterface
The bundle needs company information for meta tags and Schema.org data:
Register it as a service aliased to the interface:
2. Generate meta tags in controllers
| Option | Effect |
|---|---|
title, description |
Truncated to 60 and 160 characters |
url |
Overrides the canonical, which otherwise comes from the request |
type |
website by default; article unlocks the three article:* options below |
image |
Overrides default_image. A path is resolved against the current host |
imageWidth, imageHeight |
Declared as og:image:width / og:image:height. Worth passing: without them Facebook must download the image before deciding whether it fills a large card, and the first share of a freshly published page is the one that matters |
A page that supplies its own image never inherits default_image_width / default_image_height / default_image_alt: they describe the fallback image only |
|
imageAlt |
Declared as og:image:alt and twitter:image:alt |
imageType |
Overrides the MIME type, which is otherwise read from the extension |
publishedTime, modifiedTime, author |
article type only |
Include the meta tags template in your <head>:
3. Schema.org JSON-LD in Twig (requires twig/twig)
A JSON-LD block is data rather than code, so a browser never executes it and usually raises no
Content Security Policy violation. Enforcement is not uniform, though, and a policy naming a nonce
for script-src is written for <script> elements whatever their type. Passing the nonce settles
the question and keeps the violation reports clean:
For blogPosting, your entity must implement BlogPostingSeoInterface:
4. Sitemap (provider pattern)
Implement SitemapUrlProviderInterface for each content type:
Providers implementing SitemapUrlProviderInterface are auto-tagged and collected by the sitemap service.
5. llms.txt (provider pattern)
The /llms.txt route serves a Markdown index for LLMs (llmstxt.org). Static sections come from the llms.sections config; dynamic sections are contributed by implementing LlmsSectionProviderInterface:
Providers implementing LlmsSectionProviderInterface are auto-tagged; their sections are appended after the static config sections. Set llms.enabled: false to return a 404 for the route.
Routes
The bundle provides routes for /sitemap.xml, /robots.txt, and /llms.txt. Import them in your application:
6. SEO fields trait (optional)
Add metaDescription and metaKeywords fields to any entity:
Testing
License
MIT
All versions of seo-bundle with dependencies
symfony/config Version ^6.4 || ^7.0 || ^8.0
symfony/dependency-injection Version ^6.4 || ^7.0 || ^8.0
symfony/http-foundation Version ^6.4 || ^7.0 || ^8.0
symfony/http-kernel Version ^6.4 || ^7.0 || ^8.0
symfony/routing Version ^6.4 || ^7.0 || ^8.0