PHPackages                             wepesi/metadata - 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. wepesi/metadata

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

wepesi/metadata
===============

generate a metadata for your web page

v1.0.0(3y ago)3381[1 issues](https://github.com/bim-g/wepesi-metadata-generator/issues)Apache-2.0PHPPHP ^7.4||^8.0

Since Jun 3Pushed 3y ago1 watchersCompare

[ Source](https://github.com/bim-g/wepesi-metadata-generator)[ Packagist](https://packagist.org/packages/wepesi/metadata)[ Docs](https://github.com/bim-g/wepesi-metadata-generator)[ RSS](/packages/wepesi-metadata/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (9)Dependencies (2)Versions (15)Used By (0)

Wepesi Metadata generator
=========================

[](#wepesi-metadata-generator)

Meta tags for SEO are key because they tell search engines what a page is about. Think of them as the first impression for all search engines.

`Metadata generator` help you generate metadata for your web page with caring about the platform to be suppoterd. The oly thing is to provide information required.

Installation
============

[](#installation)

```
composer require wepesi/metadata
```

Usage
=====

[](#usage)

The fist step required to is to call `structure` a static method that give u the possibility to access the method defined.

```
    use Wepesi\MetaData;
    $meta = MetaData::build();
```

To get a structure of data to be display method are used

- `build()` : will return an instance of the class.
- `toArray()` : will return an array object of field defined.
- `toHtml()` and `generate` : will return a html meta tags that can be add to your web page,

In case there is no element defined if will return en empty array and the build will be without information.

```
  use Wepesi\MetaData;
  MetaData::build()->toArray();
  /**
      array(0) {
      }
    **/
```

All known metadata method has been define for: `title`,`lang`,`cover`,`author`,`descriptions`,`type`,`link`,`follow`,`keyword`,`index`,`nofollow`,`noIndex`,`canonical`.

Generate the meta tag
---------------------

[](#generate-the-meta-tag)

The `generate()` or `toHtml()` method will help to generate the metadata tag to be display in your head html tags,

```
    use Wepesi\MetaData;
    $meta= MetaData::build()
            ->title("Welcome To our Article")
            ->description("About Description of the article")
            ->lang("sw")
            ->type("article")
            ->link("https://www.domaine.com/about")
            ->cover("https://www.domaine.com/article-cover/cover.jpg")
            ->index()
            ->follow()
            ->toHtml();
```

```

"
```

More about metadata methods
---------------------------

[](#more-about-metadata-methods)

### Description

[](#description)

To build a useful metadata, method are well design to help no struggle with it.

#### `title` method

[](#title-method)

The title tag is the first HTML element that specifies what your web page is about. Title tags are important for SEO and visitors because they appear in the search engine results page (SERP) and in browser tabs.

```
    use Wepesi\MetaData;
    $structure= MetaData::build()->title("Welcome To Wepesi")->toArray();
    /**
    array(1) {
        ["title"]=>"Welcome To Wepesi"
    }
    */
```

#### `lang` method

[](#lang-method)

A meta lang is an HTML element that help to set the language of the webpage.

```
    use Wepesi\MetaData;
    $structure= MetaData::build()
                ->title("Welcome To Wepesi")
                ->lang("fr")
                ->toArray();
    /**
    array(1) {
      ["title"]=>"Welcome To Wepesi"
      ["lang"]=>"fr"
    }
    */
```

#### `cover` method

[](#cover-method)

A meta cover is an HTML element that help to set the image to be play on the card that will be display. supported image are `jpg` and `png`.

```
    use Wepesi\MetaData;
    $structure= MetaData::build()
                ->title("Welcome To Wepesi")
                ->lang("en")
                ->cover("https://www.domaine.com/cover.jpg")
                ->toArray();
    //array(1) {
    //  ["title"]=>"Welcome To Wepesi"
    //  ["lang"]=>"en"
    //  ["cover"]=>"https://www.domaine.com/cover.jpg"
    // }
```

#### `author` method

[](#author-method)

A meta author is an HTML element that help to provide more detail about the author.

```
    use Wepesi\MetaData;
    $structure= MetaData::build()
                ->title("Welcome To Wepesi")
                ->author("Wepesi.")
                ->toArray();
    //array(1) {
    //  ["title"]=>"Welcome To Wepesi"
    //  ["author"]=>"Wepesi"
    // }
```

#### `description` method

[](#description-method)

A meta description is an HTML element that sums up the content on your web page. Search engines typically show the meta description in search results below your title tag.

```
    use Wepesi\MetaData;
    $structure= MetaData::build()
                ->title("Welcome To Wepesi")
                ->description("Search engines typically show the meta description in search results below your title tag.")
                ->lang("fr")
                ->cover("https://www.domaine.com/cover.jpg")
                ->toArray();
    //array(1) {
    //  ["title"]=>"Welcome To Wepesi",
    //  ["description"]=>"Search engines typically show the meta description in search results below your title tag.",
    //  ["lang"]=>"fr",
    //  ["cover"]=>"https://www.domaine.com/cover.jpg",
    // }
```

#### `type` method

[](#type-method)

The type help to define whether it's about an `article` or `website` or a `blog`, there few types of metadata {article,blog,...}

```
    use Wepesi\MetaData;
    $structure= MetaData::build()
                ->title("Welcome To Wepesi")
                ->description("Search engines typically show the meta description in search results below your title tag.")
                ->lang("sw")
                ->type("article")
                ->toArray();
    //array(1) {
    //  ["title"]=>"Welcome To Wepesi",
    //  ["description"]=>"Search engines typically show the meta description in search results below your title tag.",
    //  ["lang"]=>"sw",
    //  ["type"]=>"article",
    // }
```

#### `link` method

[](#link-method)

The link method help to define whether the website link or the link of your article for redirection. in case of an article you should provide the link of the blog post, to help reach directly to the post.

```
    use Wepesi\MetaData;
    $structure= MetaData::build()
                ->title("Welcome To our Article")
                ->description("Description of the article")
                ->lang("sw")
                ->type("article")
                ->link("https://www.domaine.com/article/welcom-to-wepesi")
                ->cover("https://www.domaine.com/article-cover/cover.jpg")
                ->toArray();
    //array(1) {
    //  ["title"]=>"Welcome To our Article",
    //  ["description"]=>"Description of the article",
    //  ["lang"]=>"sw",
    //  ["type"]=>"article",
    //  ["link"]=>"https://www.domaine.com/article/welcom-to-wepesi",
    //  ["cover"]=>"https://www.domaine.com/article-cover/cover.jpg",
    // }
```

### Robots Meta Tag

[](#robots-meta-tag)

List a tags to be applied e.g.,: follow,index,nofollow,noindex `FOLLOW`: The search engine crawler will follow all the links in that webpage, `INDEX`: The search engine crawler will index the whole webpage. `NOFOLLOW` The search engine crawler will NOT follow the page and any links in that webpage. `NOINDEX`The search engine crawler will NOT index that webpages.

Use the following syntax for your robots meta tag: Oly 2 Robots tags can be used

```
    use Wepesi\MetaData;
    $structure= MetaData::build()
                ->title("Welcome To our Article")
                ->description("About Description of the article")
                ->lang("sw")
                ->type("article")
                ->link("https://www.domaine.com/about")
                ->cover("https://www.domaine.com/article-cover/cover.jpg")
                ->index()
                ->follow()
                ->toArray();
    //array(1) {
    //  ["title"]=>"Welcome To our Article",
    //  ["description"]=>"About Description of the article",
    //  ["lang"]=>"sw",
    //  ["type"]=>"article",
    //  ["link"]=>"https://www.domaine.com/article/welcom-to-wepesi",
    //  ["cover"]=>"https://www.domaine.com/article-cover/cover.jpg",
    //  ["tags"]=>["index","follow"],
    // }
```

in case you don't need to index and follow the pages use:

```
    use Wepesi\MetaData;
    $structure= MetaData::build()
                ->title("Welcome To our Article")
                ->description("About Description of the article")
                ->noindex()
                ->nofollow()
                ->toArray();
    //array(1) {
    //  ["title"]=>"Welcome To our Article",
    //  ["description"]=>"About Description of the article",
    //  ["tags"]=>["noindex","nofollow"],
    // }
```

checkout they would be the output for both example

```
 Means index and follow this webpage.
 Means not to index or not to follow this webpage.
```

#### `keywords` method

[](#keywords-method)

It’s used to add keyword witch will be help for the search engine to easily map your website. It takes parameter as string if you have one keyword, by in other way u can pass an array with multiple keyword

```
    use Wepesi\MetaData;
    $structure= MetaData::build()
                ->title("Welcome To our Article")
                ->description("About Description of the article")
                ->keywords(["HTML","CSS","JavaScript"])
                ->toArray();
    //array(1) {
    //  ["title"]=>"Welcome To our Article",

    //  ["description"]=>"About Description of the article",
    //  ["keywords"]=>["HTML","CSS","JavaScript"]
    // }
```

#### `canonical` method

[](#canonical-method)

It’s used to indicate that there are other versions of this webpage. By implementing the canonical tag in the code, your website tells search engines that this URL is the main page and that the engines shouldn’t index other pages.

```
    use Wepesi\MetaData;
    $structure = MetaData::build()
                ->title("Welcome To our Article")
                ->description("About Description of the article")
                ->canonical("https://www.domaine.com")
                ->toArray();
    //array(1) {
    //  ["title"]=>"Welcome To our Article",
    //  ["description"]=>"About Description of the article",
    //  ["canonical"]=>"https://www.domaine.com",
    // }
```

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance13

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity60

Established project with proven stability

 Bus Factor1

Top contributor holds 78.9% 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.

###  Release Activity

Cadence

Every ~32 days

Recently: every ~71 days

Total

10

Last Release

1152d ago

Major Versions

v0.4.2 → v1.0.02023-03-21

PHP version history (2 changes)v0.1PHP &gt;=7.4

v0.4.2PHP ^7.4||^8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/3b7536aed6138da14cfe4d2a295017fd44f2997ee86c689e8aa6276080164cfd?d=identicon)[ibmussa](/maintainers/ibmussa)

---

Top Contributors

[![bim-g](https://avatars.githubusercontent.com/u/16068170?v=4)](https://github.com/bim-g "bim-g (45 commits)")[![MarienMupenda](https://avatars.githubusercontent.com/u/57844897?v=4)](https://github.com/MarienMupenda "MarienMupenda (12 commits)")

---

Tags

metadataweb metadataweb app metadatawepesi-metadata

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/wepesi-metadata/health.svg)

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

###  Alternatives

[minime/annotations

The KISS PHP annotations library

229378.6k37](/packages/minime-annotations)[mhor/php-mediainfo

PHP wrapper around the mediainfo command

120574.8k7](/packages/mhor-php-mediainfo)[honeystone/laravel-seo

SEO metadata and JSON-LD package for Laravel.

34744.1k](/packages/honeystone-laravel-seo)[spiral/attributes

PHP attributes reader

233.6M45](/packages/spiral-attributes)[thomas-schulz/symfony-meta

PhpStorm meta data for expected arguments completion in symfony projects.

8957.0k](/packages/thomas-schulz-symfony-meta)[phpexiftool/exiftool

Exiftool is a library for reading, writing and editing meta information. This package is not PHP, but required for the main PHP driver : PHP Exiftool

30376.0k7](/packages/phpexiftool-exiftool)

PHPackages © 2026

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