PHPackages                             cnj/seotamic - 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. cnj/seotamic

ActiveStatamic-addon

cnj/seotamic
============

Simple SEO addon for Statamic

v5.0.2(1y ago)2127.8k↓41.7%11[3 issues](https://github.com/cnj-digital/seotamic/issues)[1 PRs](https://github.com/cnj-digital/seotamic/pulls)proprietaryPHPPHP ^8.2CI passing

Since Jun 1Pushed 1mo ago2 watchersCompare

[ Source](https://github.com/cnj-digital/seotamic)[ Packagist](https://packagist.org/packages/cnj/seotamic)[ RSS](/packages/cnj-seotamic/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)Dependencies (2)Versions (54)Used By (0)

**PRO Version:** If you are having issues with the license, make sure to add `'cnj/seotamic' => 'pro'` in the `config/statamic/editions.php` `addons` array.

Seotamic - Statamic SEO Addon
=============================

[](#seotamic---statamic-seo-addon)

Statamic v6+ only. For Statamic v5 use the 5.\* releases, for Statamic v4 use the 4.\* releases and for Statamic v3 use the 3.\* releases. Automatically adds a SEO tab to all your collection entries where you can fine tune SEO for every entry. Works perfectly with Antlers, Blade and in headless mode (PRO edition) with the Statamic REST API or GraphQL integration out of the box.

Quick Antlers usage sample
--------------------------

[](#quick-antlers-usage-sample)

```
{{ seotamic }}
```

Generates the whole array of SEO settings:

```
My Page Title

...
```

Version 6 changes
=================

[](#version-6-changes)

Seotamic v6.\* is compatible with Statamic v6.0+. The addon was fully rewritten to work with Statamic v6's Vue 3 and Inertia.js stack. No migration is needed — your existing configuration should work as-is.

Version 5 changes
=================

[](#version-5-changes)

Seotamic v5.\* is compatible with Statamic v5.0+.

Version 4.1 changes
===================

[](#version-41-changes)

Seotamic v4.1 is a minor update that adds related meta tags. The related meta tags are used to link to other pages that are related to the current page in a multisite scenario. They are available as tags and can be used in the Antlers or Blade templates. In the PRO query mode, the related meta tags are also available in the REST API and GraphQL.

Version 4 changes
=================

[](#version-4-changes)

Statamic v4 compatibility. Some internal functions were changed due to how blueprints work in Statamic v4. This release breaks compatibility with Statamic v3. Upgrade to Statamic v4 before upgrading to this version. Upgrade path from SEOtamic v2 is still the same.

Version 3 changes
=================

[](#version-3-changes)

Version 3 has breaking changes. If you update from version 1 or 2, your global settings will not be transfered. The data layout is a bit different and so is the data on specific entries.

The string tags were changed to arrays so to access the data you need to use the `:meta` or `:social` prefixes. For example `{{ seotamic:title }}` becomes `{{ seotamic:meta:title }}`.

Migration from version 2
------------------------

[](#migration-from-version-2)

If you are migrating from version 2, you can use the following command to migrate your data:

```
php artisan seotamic:migrate
```

This will migrate your global settings and all the entries. It will also remove the old fields from the entries. Make sure to backup your data before running the command.

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

[](#installation)

Include the package with composer:

```
composer require cnj/seotamic
```

The latest version requires Statamic v6+ and will auto register.

The SEO &amp; Social section tab will appear on all collection entries automatically.

Configuration (optional)
------------------------

[](#configuration-optional)

You can override the default options by publishing the configuration:

```
php artisan vendor:publish --provider="Cnj\Seotamic\ServiceProvider" --tag=config

```

This will copy the default config file to `config/seotamic.php'.

If you need to change the default assets container, make sure to apply the change in the Blueprints as well.

Usage
=====

[](#usage)

Usage is fairly simple and straight forward. You can visit the global Settings by following the Seotamic link on the navigation in the CP. Make sure to follow the instructions on each field.

[![Meta preview](./resources/screenshots/meta_preview.png)](./resources/screenshots/meta_preview.png)

After this you can fine tune the output of each collection entry by editing the SEO settings under the entry's SEO tab. From version 3 you can also preview the output of the meta and social settings. The previews should give an accurate representation of the output.

[![Social preview](./resources/screenshots/social_preview.png)](./resources/screenshots/social_preview.png)

Antlers
-------

[](#antlers)

There are several antler tags available, the easiest is to just include the do everything base tag in the head of your layout:

```
{{ seotamic }}

```

If you need more control you can manually get each part of the output by using:

```
{{ seotamic:meta:title }}
{{ seotamic:meta:description }}
{{ seotamic:meta:canonical }}
{{ seotamic:meta:robots }}
{{ seotamic:meta:related }}

```

This will return strings, so you need to wrap them in the appropriate tags, ie:

```
{{ seotamic:meta:title }}
```

Social ones will still return everything with these tags (the general one returns this as well)

```
{{ seotamic:og }}
{{ seotamic:twitter }}

```

If you need more control you can manually get each part of the output by using:

```
{{ seotamic:social:title }}
{{ seotamic:social:description }}
{{ seotamic:social:image }}
{{ seotamic:social:site_name }}

```

This will return strings, so you need to wrap them in the appropriate tags.

Blade
-----

[](#blade)

Similarly to the Antlers usage, you can use the same tags using Blade:

```
{!! Statamic::tag('seotamic')->context(get_defined_vars()) !!}
```

It works similary to the Antlers tags, so you can use single values as well.

Headless (PRO)
--------------

[](#headless-pro)

Headless use is straightforward. If using the REST API or GraphQL, the entry will include three Seotamic fields: `seotamic_meta`, `seotamic_social` with the prefilled SEO data.

You can also set the base canonical url in the config file by setting a value for `headless_mode`. The default value is `false`, but setting it to `https://mydomain.com` will change all canonical urls. The images will NOT use this base url, as they are still served from Statamic.

**Headless usage is supported only for the PRO version.**

Sitemap (PRO)
-------------

[](#sitemap-pro)

Sitemap is autogenerated under the `/sitemap.xml` url if the sitemap config options are set to true (default).

**Sitemap is supported only for the PRO version.**

Dynamic OG Image injection
--------------------------

[](#dynamic-og-image-injection)

In projects where you want the OG Image to be dynamic, for now you can use this ViewModel and inject it to your collection in order to dynamically assign the OG Image.

```
