PHPackages                             gercoli/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. [Utility &amp; Helpers](/categories/utility)
4. /
5. gercoli/metatags

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

gercoli/metatags
================

Wrapper for the HTMLTags class geared toward meta tags.

06PHP

Since Feb 22Pushed 11y ago1 watchersCompare

[ Source](https://github.com/Gercoli/MetaTags)[ Packagist](https://packagist.org/packages/gercoli/metatags)[ RSS](/packages/gercoli-metatags/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

MetaTags
========

[](#metatags)

An extension for GErcoli/HTMLTags to make managing common meta tags easier.

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

[](#installation)

Include this into your composer.json file:

```
{
    "require": {
        "gercoli/metatags": "dev-master"
    }
}
```

Using the class
---------------

[](#using-the-class)

The MetaTags class uses fully qualified name spaces, so for easier use, add `use GErcoli\MetaTags\MetaTags` into your php file. Secondly, the class has been designed to be used statically and the various setter methods can be chained together.

### Example of a simple tag

[](#example-of-a-simple-tag)

```
    MetaTags::setTitle("This is the page title");

    echo MetaTags::getTitle();
    // output:
    // "This is the page title"

    MetaTags::renderTitle();
    // output:
    // This is the page title

    MetaTags::setCharset("UTF-8")
        ->setDescription("This is the page \"description\".")
        ->renderAll();
    // output:
    //
    //  This is the page title
    //
```

### Custom tags

[](#custom-tags)

It is inevitable that there will tags that you need to output/render that do not have easy-to-access class methods, for this purpose I've added the addCustomTag(HTMLTag) method, where you can use the dependant class [\\GErcoli\\HTMLTags\\HTMLTag](https://github.com/Gercoli/HTMLTags) to create an HTMLTag and insert it manually.

```
    // Create the custom tag via the HTMLTag class:
    $tag = (new HTMLTag("meta"))
        ->setAttribute("http-equiv","Content-Language")
        ->setAttribute("content","en");

    // Add the created tag to the MetaTags object,
    // and render only the very last tag that was added:
    MetaTags::addCustomTag($tag)->renderLast();

    // output:
    //
```

###  Health Score

20

—

LowBetter than 14% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/48e2c3ac2013742f6201e4364a37a38ce6ec1992aaccb5511de0cd100f64b2b9?d=identicon)[GErcoli](/maintainers/GErcoli)

---

Top Contributors

[![Gercoli](https://avatars.githubusercontent.com/u/1308491?v=4)](https://github.com/Gercoli "Gercoli (52 commits)")

### Embed Badge

![Health badge](/badges/gercoli-metatags/health.svg)

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

###  Alternatives

[brick/math

Arbitrary-precision arithmetic library

2.1k504.0M277](/packages/brick-math)[jenssegers/agent

Desktop/mobile user agent parser with support for Laravel, based on Mobiledetect

4.8k67.8M440](/packages/jenssegers-agent)[google/cloud-core

Google Cloud PHP shared dependency, providing functionality useful to all components.

343121.4M79](/packages/google-cloud-core)[marc-mabe/php-enum

Simple and fast implementation of enumerations with native PHP

49444.8M97](/packages/marc-mabe-php-enum)[illuminate/collections

The Illuminate Collections package.

27171.5M822](/packages/illuminate-collections)[php-ds/php-ds

Specialized data structures as alternatives to the PHP array

4108.8M134](/packages/php-ds-php-ds)

PHPackages © 2026

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