PHPackages                             maatify/seo - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. maatify/seo

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

maatify/seo
===========

Standalone SEO library for metadata, JSON-LD, sitemaps, hreflang, redirects, slug history, and SEO validation.

v1.0.0-rc.1(3d ago)00MITPHP &gt;=8.2

Since Jul 5Compare

[ Source](https://github.com/Maatify/seo)[ Packagist](https://packagist.org/packages/maatify/seo)[ Docs](https://github.com/Maatify/seo)[ RSS](/packages/maatify-seo/feed)WikiDiscussions Synced today

READMEChangelog (1)Dependencies (1)Versions (2)Used By (0)

Maatify SEO Library
===================

[](#maatify-seo-library)

[![Maatify.dev](https://camo.githubusercontent.com/bb8bf9ee079d7f823c9d5e94061d1d4c11dc0898e2b1b5cc9a8a7b04d8bfdd7d/68747470733a2f2f7777772e6d6161746966792e6465762f6173736574732f696d672f696d672f6d6161746966795f6c6f676f5f77686974652e737667)](https://camo.githubusercontent.com/bb8bf9ee079d7f823c9d5e94061d1d4c11dc0898e2b1b5cc9a8a7b04d8bfdd7d/68747470733a2f2f7777772e6d6161746966792e6465762f6173736574732f696d672f696d672f6d6161746966795f6c6f676f5f77686974652e737667)

---

[![Latest Version](https://camo.githubusercontent.com/93d6b44a61f84608b6d60f19735faec3b0b922d3b7fea3aaac9ff1c29cb27d56/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6d6161746966792f73656f3f7374796c653d666f722d7468652d6261646765)](https://packagist.org/packages/maatify/seo)[![PHP Version](https://camo.githubusercontent.com/ccafd80d7420691769d81eb273f78d36deb864c8d80aaaf5884d5f63bd5bbbbd/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f6d6161746966792f73656f3f7374796c653d666f722d7468652d6261646765)](https://packagist.org/packages/maatify/seo)[![License](https://camo.githubusercontent.com/c8e43895daa27c2fcdf495d454223483b941a4d149c3d20f2627a5e872a8a085/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f6d6161746966792f73656f3f7374796c653d666f722d7468652d6261646765)](https://packagist.org/packages/maatify/seo)

[![PHPStan](https://camo.githubusercontent.com/f85016b73718ab38275b913dafed1c1ce7f287c3c2ec319445bc29011149f408/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048505374616e2d4c6576656c2532304d61782d344538434145)](https://camo.githubusercontent.com/f85016b73718ab38275b913dafed1c1ce7f287c3c2ec319445bc29011149f408/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048505374616e2d4c6576656c2532304d61782d344538434145)

[![Changelog](https://camo.githubusercontent.com/32f7664d004132f7e0fb111b5e01bd7270705d1e7247db502287d51910c04cb9/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4368616e67656c6f672d566965772d626c7565)](CHANGELOG.md)[![Security](https://camo.githubusercontent.com/a150750c8b2c6ca6209aa80bdf220d2f0950b984df64c1b859a46ee9152570f3/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f53656375726974792d506f6c6963792d696d706f7274616e74)](SECURITY.md)

[![Monthly Downloads](https://camo.githubusercontent.com/f69fb956bbcddef9481cc1429b70b0866e86e68c64d9d45971abf28f55d8eaa1/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f646d2f6d6161746966792f73656f3f6c6162656c3d4d6f6e74686c79253230446f776e6c6f61647326636f6c6f723d303041384538)](https://camo.githubusercontent.com/f69fb956bbcddef9481cc1429b70b0866e86e68c64d9d45971abf28f55d8eaa1/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f646d2f6d6161746966792f73656f3f6c6162656c3d4d6f6e74686c79253230446f776e6c6f61647326636f6c6f723d303041384538)[![Total Downloads](https://camo.githubusercontent.com/25a098601caf2ac0165a99810857e072916881271e1599a4ad0c242a5044442b/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6d6161746966792f73656f3f6c6162656c3d546f74616c253230446f776e6c6f61647326636f6c6f723d324141394530)](https://camo.githubusercontent.com/25a098601caf2ac0165a99810857e072916881271e1599a4ad0c242a5044442b/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6d6161746966792f73656f3f6c6162656c3d546f74616c253230446f776e6c6f61647326636f6c6f723d324141394530)

[![Maatify Ecosystem](https://camo.githubusercontent.com/0bfd6db80f9a39f03dac1923cc79f27a507f2fdf59b3a853dc0af26be1343315/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4d6161746966792d45636f73797374656d2d626c756576696f6c65743f7374796c653d666f722d7468652d6261646765)](https://camo.githubusercontent.com/0bfd6db80f9a39f03dac1923cc79f27a507f2fdf59b3a853dc0af26be1343315/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4d6161746966792d45636f73797374656d2d626c756576696f6c65743f7374796c653d666f722d7468652d6261646765)

[![Install](https://camo.githubusercontent.com/2eac40f99482a9257c5ca42abf54d9973edf8095a034d04637efeb4a92f2d13a/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f496e7374616c6c2d636f6d706f736572253230726571756972652d626c75653f7374796c653d666f722d7468652d6261646765)](https://packagist.org/packages/maatify/seo)

A framework-agnostic PHP SEO library for metadata generation, JSON-LD schemas, sitemaps, hreflang, redirects, slug history, validation, and admin-oriented SEO tooling.

Table of Contents
-----------------

[](#table-of-contents)

- [Installation](#installation)
- [Requirements](#requirements)
- [Quick Start](#quick-start)
- [Features](#features)
- [Practical Examples](#practical-examples)
- [Architecture Overview](#architecture-overview)
- [Documentation](#documentation)
- [Design Principles](#design-principles)
- [License](#license)

Installation
------------

[](#installation)

```
composer require maatify/seo
```

Requirements
------------

[](#requirements)

- PHP &gt;= 8.2
- `ext-xmlwriter`

Quick Start
-----------

[](#quick-start)

Creating a basic page metadata output and rendering it using existing public APIs:

```
use Maatify\Seo\Shared\DTO\MetaTagsDTO;
use Maatify\Seo\Web\Render\SeoHeadHtmlRenderer;

$metaTags = new MetaTagsDTO(
    title: 'About Us',
    description: 'Learn more about our framework-agnostic SEO library.',
    canonicalUrl: 'https://example.com/about',
    openGraphTitle: 'About Us',
    openGraphDescription: 'Learn more about our framework-agnostic SEO library.',
    openGraphUrl: 'https://example.com/about',
    openGraphType: 'website',
);

$renderer = new SeoHeadHtmlRenderer();
echo $renderer->render($metaTags);
```

Features
--------

[](#features)

- **Metadata generation:** Easily construct standard HTML meta tags and canonical URLs.
- **JSON-LD schemas:** Framework-agnostic structured data generation for SEO (e.g., Breadcrumbs, Products) via strictly typed DTOs.
- **Social metadata:** Generate Open Graph and Twitter Card tags seamlessly.
- **Sitemap generation:** In-memory XML sitemap generation stream dynamically powered by strict DTOs.
- **Hreflang support:** Multi-language indexing (`xhtml:link`) generation helpers.
- **Redirects and slug history:** Logic to manage URL migrations and legacy paths cleanly.
- **SEO validation and scoring:** Audit generated SEO metadata arrays or objects to warn about missing fields, conflicts, and compute actionable SEO scores.
- **Import/export:** SEO metadata import and export functionality for administrative portability.
- **Admin tooling:** Admin-specific commands and queries for managing SEO overrides, tracking slug history, and SERP/Social previews.
- **Framework-agnostic architecture:** 100% PHP domain logic with zero framework or UI dependencies, ready to drop into any stack.

Practical Examples
------------------

[](#practical-examples)

To see how the library functions in real-world scenarios, you can run the following standalone examples from the command line:

- `php examples/admin-previews.php`: Generate SERP and Social previews for admin interfaces.
- `php examples/basic-head-render.php`: Rendering of standard meta tags and array-based JSON-LD.
- `php examples/category-page-seo.php`: Construct schema and metadata for category pages using FluentSeoBuilder.
- `php examples/hreflang-generation.php`: Hreflang link generation for multi-language indexing.
- `php examples/import-export.php`: SEO metadata import and export functionalities.
- `php examples/meta-robots-canonical.php`: Construct meta robots tags and canonical URLs.
- `php examples/product-page-seo.php`: Open graph tags and schema generation for product pages.
- `php examples/schema-output.php`: Outputs structured data schemas from arrays, DTOs, and adapted optional Spatie objects.
- `php examples/seo-page-presets.php`: Generic, e-commerce, content, and local business SEO page presets.
- `php examples/sitemap-output.php`: Native sitemap XML outputs using provided DTOs and renderers.
- `php examples/social-builders.php`: OpenGraph and TwitterCard builders to generate social metadata.
- `php examples/phase7-output-showcase.php`: Showcases rendered SEO head output helpers and DTO output sections.
- `php examples/phase13-jsonld-builders.php`: Demonstrates the JSON-LD builder suite across supported schema types.

Architecture Overview
---------------------

[](#architecture-overview)

The library follows a strict layered architecture to ensure clean separation of concerns and maximum portability.

**Core Library**↓ **Admin Essentials**↓ **Host Application**

- **No Controllers:** Routing decisions are strictly the host application's responsibility.
- **No UI:** The library provides raw strings, arrays, or DTOs. Any HTML rendering is purely optional utility output, avoiding template engine coupling.
- **No Framework Dependency:** Built with standard PHP, using generic contracts (interfaces) to integrate with frameworks.
- **No ORM Dependency:** Database interactions are defined by abstract repositories, allowing the host application to use Doctrine, Eloquent, or native PDO.

Documentation
-------------

[](#documentation)

Full documentation, including internal compliance checks, library references, and guides:

- [docs/](docs/) - Central repository for library documentation.
- [Roadmap](docs/roadmap/) - Development and feature roadmap.
- [Proposals](docs/proposals/) - Architectural design proposals.
- [Verification Reports](docs/verification/) - Detailed audit trails and release readiness reports.

Design Principles
-----------------

[](#design-principles)

This library strictly adheres to Maatify's core design standards for standalone libraries:

- **Host-Agnostic:** Designed to plug into any existing PHP project using standardized interface definitions.
- **Pure Domain Logic:** Excludes any coupling to HTTP requests, global `$_SERVER` states, or environment `.env` files.
- **Testable:** Easily unit tested via straightforward constructor injection.
- **Extensible:** Internal Builders and Services are composed, allowing developers to inject custom overrides via Dependency Injection.

License
-------

[](#license)

This package is open-sourced software licensed under the [MIT license](LICENSE).

###  Health Score

34

—

LowBetter than 75% of packages

Maintenance99

Actively maintained with recent releases

Popularity0

Limited adoption so far

Community2

Small or concentrated contributor base

Maturity31

Early-stage or recently created project

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

3d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/1a885a0810f2762586520ab284c9019aaf0b650b53cdf2a6c13ea10931bb7795?d=identicon)[Maatify](/maintainers/Maatify)

---

Tags

schemametadataJSON-LDSitemapseotwitter cardrobotsopen-graphcanonicalhreflang

###  Code Quality

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

![Health badge](/badges/maatify-seo/health.svg)

```
[![Health](https://phpackages.com/badges/maatify-seo/health.svg)](https://phpackages.com/packages/maatify-seo)
```

###  Alternatives

[nystudio107/craft-seomatic

SEOmatic facilitates modern SEO best practices &amp; implementation for Craft CMS 5. It is a turnkey SEO system that is comprehensive, powerful, and flexible.

1741.5M67](/packages/nystudio107-craft-seomatic)[coffeecode/optimizer

Optimizer makes it easy to bookmark your site tags, open graph and twitter card

78062.5k2](/packages/coffeecode-optimizer)[honeystone/laravel-seo

SEO metadata and JSON-LD package for Laravel.

35590.0k](/packages/honeystone-laravel-seo)[devrabiul/laravel-seo-manager

Laravel SEO Manager is an SEO tool that improves SEO by adding recommended meta tags.

396.8k](/packages/devrabiul-laravel-seo-manager)[larament/seokit

A complete SEO package for Laravel, covering everything from meta tags to social sharing and structured data.

452.8k](/packages/larament-seokit)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
