PHPackages                             luisinder/social-metatags - 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. luisinder/social-metatags

ActiveLibrary

luisinder/social-metatags
=========================

Lightweight PHP library to generate common Twitter Card &amp; Open Graph meta tags.

2.0.0(9mo ago)0181[1 PRs](https://github.com/luisinder/social-metatags/pulls)MITPHPPHP &gt;=8.2

Since Apr 25Pushed 9mo ago1 watchersCompare

[ Source](https://github.com/luisinder/social-metatags)[ Packagist](https://packagist.org/packages/luisinder/social-metatags)[ RSS](/packages/luisinder-social-metatags/feed)WikiDiscussions master Synced today

READMEChangelogDependenciesVersions (9)Used By (0)

Social Meta Tags
================

[](#social-meta-tags)

[![Latest Stable Version](https://camo.githubusercontent.com/a0d1c62b6db00317daad90caf9a85e188c2a9dbddb03dc597ba8bc7786220721/68747470733a2f2f706f7365722e707567782e6f72672f6c756973696e6465722f736f6369616c2d6d657461746167732f762f737461626c65)](https://packagist.org/packages/luisinder/social-metatags)[![Total Downloads](https://camo.githubusercontent.com/e5863ac857b22fe44a87780a8d6c3036c00cfd393d4bc2e1d1648bdceb49d19c/68747470733a2f2f706f7365722e707567782e6f72672f6c756973696e6465722f736f6369616c2d6d657461746167732f646f776e6c6f616473)](https://packagist.org/packages/luisinder/social-metatags)[![License](https://camo.githubusercontent.com/a0c0b60e299a6da18beda5d537eb58ca3465d6936a824ddbd6a48dcf3f3c4900/68747470733a2f2f706f7365722e707567782e6f72672f6c756973696e6465722f736f6369616c2d6d657461746167732f6c6963656e7365)](https://packagist.org/packages/luisinder/social-metatags)

Lightweight PHP (PSR-4) helper to generate the most common Twitter Card and Open Graph meta tags.

Features
--------

[](#features)

- Simple static API (a single final class).
- Escapes all values with `htmlspecialchars()` to avoid XSS injection.
- Correct Twitter description truncation (≤ 200 chars).
- PHP 8.2+ typed code, `strict_types=1`.
- Zero dependencies.

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

[](#installation)

Using Composer:

```
composer require luisinder/social-metatags
```

The library autoloads via PSR-4 (`Luisinder\\`).

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

[](#quick-start)

```
