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

[stefangabos/zebra_pagination

A generic, Twitter Bootstrap compatible, PHP pagination library that automatically generates navigation links

11122.9k](/packages/stefangabos-zebra-pagination)[dannyvanholten/acf-gravityforms-add-on

Advanced Custom Fields: Gravity Forms Add-on

7943.0k](/packages/dannyvanholten-acf-gravityforms-add-on)[danielme85/laravel-cconverter

Laravel 5 plug-in for currency conversion

42101.1k](/packages/danielme85-laravel-cconverter)[inpsyde/google-tag-manager

Adds the Google Tag Manager container snippet to your site and populates the Google Tag Manager Data Layer.

2359.7k](/packages/inpsyde-google-tag-manager)[cagartner/bagisto-brazilcustomer

112.9k](/packages/cagartner-bagisto-brazilcustomer)[codein/ibexa-seo-toolkit

Ibexa Toolkit to advise users on best SEO practices.

112.5k](/packages/codein-ibexa-seo-toolkit)

PHPackages © 2026

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