PHPackages                             innis-maggiore/silverstripe-social-meta-tags - 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. innis-maggiore/silverstripe-social-meta-tags

ActiveSilverstripe-vendormodule[Utility &amp; Helpers](/categories/utility)

innis-maggiore/silverstripe-social-meta-tags
============================================

Adds social media meta tags to Silverstripe sites.

6.0.4(5mo ago)1893↓50%2BSD-3-ClausePHPPHP &gt;=8.3

Since Apr 26Pushed 5mo agoCompare

[ Source](https://github.com/innis-maggiore/silverstripe-social-meta-tags)[ Packagist](https://packagist.org/packages/innis-maggiore/silverstripe-social-meta-tags)[ Docs](https://github.com/innis-maggiore/silverstripe-social-meta-tags)[ RSS](/packages/innis-maggiore-silverstripe-social-meta-tags/feed)WikiDiscussions master Synced yesterday

READMEChangelog (6)Dependencies (1)Versions (12)Used By (0)

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

[](#silverstripe-social-meta-tags)

Adds social media meta tags to Silverstripe sites.

Description
-----------

[](#description)

**silverstripe-social-meta-tags** adds social media meta tags for OpenGraph (Facebook) and Twitter to SiteTree and child page types.

Supported social media meta tags include:

- OpenGraph (Facebook)
    - `og:site_name`
    - `og:title`
    - `og:image`
    - `og:description`
    - `og:url`
- Twitter
    - `twitter:site`
    - `twitter:title`
    - `twitter:image`
    - `twitter:description`
    - `twitter:card`

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

[](#requirements)

SilverStripe 4.2+

Use the `1.0.1` tag ([ss3 branch](https://github.com/innis-maggiore/silverstripe-social-meta-tags/tree/1.0.1)) for SilverStripe 3 sites.

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

[](#installation)

1. `composer require innis-maggiore/silverstripe-social-meta-tags ^4.0`
2. run a `/dev/build?flush=all`
3. Without any configuration, the module will begin rendering social media meta tags for all page types.

Defaults
--------

[](#defaults)

By default, the module will use the following fields to populate the meta tags:

- `og:type` --&gt; `"website"`
- `og:site_name` --&gt; `SiteConfig.Title`
- `og:title` --&gt; `Title`
- `og:description` --&gt; `MetaDescription`
- `og:url` --&gt; `AbsoluteLink()`
- `twitter:title` --&gt; `Title`
- `twitter:description` --&gt; `MetaDescription`
- `twitter:card` --&gt; `"summary"`

NOTE: `twitter:card` will be set to `"summary"` by default, unless an image field is used. If an image field is used, the content will be set to `"summary_large_image"`.

Configuration
-------------

[](#configuration)

Configure the module by editing `mysite/_config/config.yml` and set the following options:

```
InnisMaggiore\SocialMetaTags:
  default_title: 'Title'
  default_description: 'MetaDescription'
  meta_description_default: true
  twitter_site: ''
  titles:
    Fully\Namespaced\ClassName: 'FieldName'
    Fully\Namespaced\ClassName1: 'FieldName1'
  descriptions:
    Fully\Namespaced\ClassName: 'FieldName'
    Fully\Namespaced\ClassName1: 'FieldName1'
  images:
    Fully\Namespaced\ClassName: 'FieldName'
    Fully\Namespaced\ClassName1: 'FieldName1'
  types:
    Fully\Namespaced\ClassName: 'website'
    Fully\Namespaced\ClassName1: 'article'
```

- `default_title` - override the default title field to use; `PageTitle` is used by default.
- `default_description` - override the default description field to use; `MetaDescription` is used by default.
- `meta_description_default` - flag that indicates whether to fall back to `MetaDescription` if the chosen description field is empty.
- `twitter_site` - the content to be used for thw `twitter:site` meta tag.
- `titles` - an array of class names, with the value being the name of the Text field to use for title meta tags. Useful for adding social media meta tag output to DataObjects.
- `descriptions` - an array of class names, with the value being the name of the Text field to use for description meta tags. Useful for adding social media meta tag output to DataObjects.
- `images` - an array of class names, with the value being the name of the Image field to use for image meta tags. Useful for adding social media meta tag output to DataObjects.
- `types` - an array of class names, with the value being the content to use for `og:type` met tag.

Example `config.yml`
--------------------

[](#example-configyml)

```
InnisMaggiore\SocialMetaTags:
  default_title: 'PageTitle'
  default_description: ''
  meta_description_default: true
  titles:
    InnisMaggiore\Models\Category: 'Name'
    InnisMaggiore\Models\Product: 'Name'
    InnisMaggiore\Models\Recipe: 'Name'
  descriptions:
    InnisMaggiore\Models\Category: 'ShortDescr'
    InnisMaggiore\Models\Product: 'Summary'
    InnisMaggiore\Models\Recipe: 'MetaDescription'
  images:
    InnisMaggiore\Pagetypes\AboutUsPage: 'LogoImage'
    InnisMaggiore\Models\Category: 'BeautyShot'
    InnisMaggiore\Models\Product: 'BeautyShot'
    InnisMaggiore\Models\Recipe: 'Image'
  types:
    InnisMaggiore\Models\Recipe: 'article'
  twitter_site: ''
```

Adding social media meta tags to DataObjects
--------------------------------------------

[](#adding-social-media-meta-tags-to-dataobjects)

By default, this module will only add social media meta tags to SiteTree objects.

To add social media meta tags to DataObjects:

- in `_config/config.yml`, add the extension to each DataObject class you wish:

```
Fully\Namespaced\Dataobject:
  extensions:
    - InnisMaggiore\SilverstripeSocialMetaTags\SocialMetaTagsExtension
```

- in `_config/config.yml`, set options for `titles`, `descriptions`, and `images` (if desired) for your class.
    - for an example, see the above example `config.yml`.
- in your DataObject's class, add new fields in `getCMSFields()`:

```
  public function getCMSFields() {
      $fields = parent::getCMSFields();

      ...

      $fields->addFieldToTab('Root.Main', new TextareaField("SocialMetaDescription"));
      $fields->addFieldToTab('Root.Main', new UploadField("SocialMetaImage"));

      return $fields;
  }
```

- run a `/dev/build?flush=all`

License
-------

[](#license)

This project is licensed under the [New BSD License](./LICENSE)

###  Health Score

45

—

FairBetter than 92% of packages

Maintenance72

Regular maintenance activity

Popularity18

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity66

Established project with proven stability

 Bus Factor1

Top contributor holds 66.7% 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 ~95 days

Recently: every ~238 days

Total

11

Last Release

161d ago

Major Versions

1.0.1 → 4.0.02023-04-26

4.0.4 → 5.0.02023-08-02

5.0.0 → 6.0.22025-07-09

PHP version history (2 changes)4.0.0PHP &gt;=5.6

6.0.2PHP &gt;=8.3

### Community

Maintainers

![](https://www.gravatar.com/avatar/a7322c8467d3bd78d2bd27756b5015bf4e37c131644c5c74b3e008c61edada0c?d=identicon)[innismaggiore](/maintainers/innismaggiore)

---

Top Contributors

[![jchenevey](https://avatars.githubusercontent.com/u/8449994?v=4)](https://github.com/jchenevey "jchenevey (6 commits)")[![kevin-hine-innis](https://avatars.githubusercontent.com/u/83420315?v=4)](https://github.com/kevin-hine-innis "kevin-hine-innis (3 commits)")

---

Tags

silverstripesocial mediameta-tags

### Embed Badge

![Health badge](/badges/innis-maggiore-silverstripe-social-meta-tags/health.svg)

```
[![Health](https://phpackages.com/badges/innis-maggiore-silverstripe-social-meta-tags/health.svg)](https://phpackages.com/packages/innis-maggiore-silverstripe-social-meta-tags)
```

###  Alternatives

[jonom/silverstripe-share-care

Social media sharing previews and customisation for Silverstripe

2932.7k1](/packages/jonom-silverstripe-share-care)

PHPackages © 2026

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