PHPackages                             vaersaagod/seomate - 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. vaersaagod/seomate

ActiveCraft-plugin[Utility &amp; Helpers](/categories/utility)

vaersaagod/seomate
==================

SEO, mate! It's important.

3.2.0(10mo ago)4341.6k↓38.1%8[1 issues](https://github.com/vaersaagod/seomate/issues)2MITPHPPHP ^8.2

Since May 24Pushed 10mo ago4 watchersCompare

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

READMEChangelog (10)Dependencies (2)Versions (77)Used By (2)

SEOMate plugin for Craft CMS
============================

[](#seomate-plugin-for-craft-cms)

SEO, mate! It's important. That's why SEOMate provides the tools you need to craft all the meta tags, sitemaps and JSON-LD microdata you need - in one highly configurable, open and friendly package - with a super-light footprint.

SEOMate aims to do less! Unlike other SEO plugins for Craft, there are no control panel settings or fieldtypes. Instead, you configure everything from the plugin's config file, which makes it easy and quick to set up, bootstrap and version control your configuration. All the data is pulled from native Craft fields, which makes for less maintenance over time, *and keeps you in control of your data*.

Additionally, SEOMate adds a super-awesome SEO/social media preview to your Control Panel. The SEO preview taps into Craft's native Preview Targets, giving your clients a nice and familiar interface for previewing how their content will appear on Google, Facebook and Twitter.

[![Screenshot](resources/plugin_logo.png)](resources/plugin_logo.png)

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

[](#requirements)

This plugin requires Craft CMS 5.0.0 or later.

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

[](#installation)

To install the plugin, either install it from the plugin store, or follow these instructions:

1. Install with composer via `composer require vaersaagod/seomate` from your project directory.
2. Install the plugin in the Craft Control Panel under Settings → Plugins, or from the command line via `./craft install/plugin seomate`.
3. For SEOMate to do anything, you need to [configure it](#configuring). But first, continue reading!

---

SEOMate Overview
----------------

[](#seomate-overview)

SEOMate focuses on providing developers with the tools they need to craft their site's SEO in three main areas; **meta data**, **sitemaps**, and **JSON-LD microdata**.

### Meta data

[](#meta-data)

SEOMate doesn't provide any custom field types for entering meta data. Instead, you use native field types that come with Craft, and just tell SEOMate which fields to use.

You do this by configuring *field profiles* for the different field setups in your site. Sections and category groups can be mapped to these profiles, or the desired profile can be set at the template level.

The key config settings for meta data is `fieldProfiles`, `profileMap`, `defaultProfile`, `defaultMeta` and `additionalMeta`. Refer to the ["Adding meta data"](#adding-meta-data)section on how to include the meta data in your page, and how to (optionally) override it at the template level.

### Sitemaps

[](#sitemaps)

SEOMate lets you create completely configuration based sitemaps for all your content. The sitemaps are automatically updated with new elements, and will automatically be split into multiple sitemaps for scalability.

To enable sitemaps, set the `sitemapEnabled` config setting to `true` and configure the contents of your sitemaps with `sitemapConfig`. Refer to the ["Enabling sitemaps"](#enabling-sitemaps)section on how to enable and set up your sitemaps.

### JSON-LD

[](#json-ld)

SEOMate provides a thin wrapper around the excellent [`spatie/schema-org`](https://github.com/spatie/schema-org)package used for generating JSON-LD data structures. SEOMate exposes the `craft.schema`template variable, that directly ties into the fluent [Schema API](https://github.com/spatie/schema-org/blob/master/src/Schema.php).

*This method uses the exact same approach and signature as [Rias' Schema plugin](https://github.com/Rias500/craft-schema). If you're only looking for a way to output JSON-LD, we suggest you use that plugin instead*.

### SEO preview

[](#seo-preview)

SEOMate provides a fancy "SEO Preview" preview target, for any and all elements with URLs, featuring *photo realistic approximations* of how your content will appear in Google SERPs, or when shared on Facebook, Twitter/X and LinkedIn.

[![img.png](resources/seo-preview.png)](resources/seo-preview.png)

*If you don't like the SEO preview, or if you'd like it to only appear for entries in specific sections, check out the [previewEnabled](%60#previewenabled-boolarray%60) config setting.*

### Things that SEOMate doesn't do...

[](#things-that-seomate-doesnt-do)

So much!

---

Adding meta data
----------------

[](#adding-meta-data)

Out of the box, SEOMate doesn't add anything to your markup. To get started, add `{% hook 'seomateMeta' %}` to the `` of your layout. Then, if you haven't already, create a config file named `seomate.php` in your `config` folder alongside your other Craft config files. This file can use [multi-environment configs](https://docs.craftcms.com/v3/config/environments.html#config-files), exactly the same as any other config file in Craft, but in the following examples we'll skip that part to keep things a bit more tidy.

All the config settings are documented in the [`Configuring`](#configuring) section, and there are quite a few! But to get you going, these are some fundamental concepts:

### Field profiles

[](#field-profiles)

A *field profile* in SEOMate is, essentially, a mapping of metadata attributes to the fields that SEOMate should look at for those attributes' metadata values.

To get started, create a profile called "standard" in `fieldProfiles`, and set that profile as the default field profile using the `defaultProfile` setting:

```
