PHPackages                             johannschopplich/kirby-serp-preview - 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. johannschopplich/kirby-serp-preview

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

johannschopplich/kirby-serp-preview
===================================

Kirby Panel plugin for search engine result page previews

1.3.1(12mo ago)292.4k↓35.7%21MITPHP

Since Dec 10Pushed 1mo ago2 watchersCompare

[ Source](https://github.com/johannschopplich/kirby-serp-preview)[ Packagist](https://packagist.org/packages/johannschopplich/kirby-serp-preview)[ Docs](https://github.com/johannschopplich/kirby-serp-preview#readme)[ Fund](https://kirby.tools)[ RSS](/packages/johannschopplich-kirby-serp-preview/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (10)Dependencies (2)Versions (24)Used By (1)

[![Kirby Search Engine Result Page Preview screenshot](./.github/kirby-serp-preview.png)](./.github/kirby-serp-preview.png)

Kirby SERP Preview
==================

[](#kirby-serp-preview)

Preview how your pages will appear in Google search results, directly in the Kirby Panel.

Features
--------

[](#features)

- 🎯 Google-style search result preview in the Panel
- 🌓 Dark and light mode support (adapts to Panel theme)
- 🧩 Kirby query language support in configuration
- 🗺️ Multi-language ready
- ✂️ Custom formatters for title and description
- 📊 Optional Google Search Console link

Tip

Ready for Kirby 5! The plugin adapts to the Panel theme and uses Google's dark mode colors.

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

[](#requirements)

- Kirby 4 or Kirby 5

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

[](#installation)

### Composer

[](#composer)

```
composer require johannschopplich/kirby-serp-preview
```

### Download

[](#download)

Download and copy this repository to `/site/plugins/kirby-serp-preview`.

Quick Start
-----------

[](#quick-start)

Add the section to any page blueprint:

```
sections:
  serp-preview:
    type: serp-preview
```

That's it! The preview will show:

- **Title:** Page title + separator + site title
- **URL:** Your site URL + page path
- **Description:** Empty (until configured)

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

[](#configuration)

### Full Example

[](#full-example)

```
sections:
  serp-preview:
    type: serp-preview
    # Site information
    siteTitle: "{{ site.title.value }}"
    siteUrl: "{{ kirby.url }}"
    faviconUrl: "{{ site.favicon.toFile.url }}"
    titleSeparator: "-"
    # Custom title (overrides default)
    titleContentKey: metaTitle
    defaultTitle: "{{ page.title.value }}"
    # Custom description
    descriptionContentKey: metaDescription
    defaultDescription: "{{ site.metaDescription.value }}"
    # Optional
    searchConsoleUrl: "https://search.google.com/search-console"
```

### Options Reference

[](#options-reference)

Options marked with **Query** support [Kirby's query language](https://getkirby.com/docs/guide/blueprints/query-language), e.g. `{{ site.title.value }}`.

OptionDefaultQueryDescription`siteTitle``{{ site.title.value }}`YesSite name shown in the preview`siteUrl``{{ kirby.url }}`YesSite URL shown in the preview`faviconUrl`–YesURL to your favicon`titleSeparator``–`YesSeparator between page title and site title`titleContentKey`–NoField name for custom title (e.g. `metaTitle`)`defaultTitle`–YesFallback title if `titleContentKey` is empty`descriptionContentKey`–NoField name for custom description (e.g. `metaDescription`)`defaultDescription`–YesFallback description if `descriptionContentKey` is empty`searchConsoleUrl`–NoShows a link button to Google Search ConsoleHow It Works
------------

[](#how-it-works)

### Title Resolution

[](#title-resolution)

The preview title is determined in this order:

```
┌─────────────────────────────────────────────────────────────┐
│                                                             │
│  1. titleContentKey field has value?                        │
│     ├─ YES → Use field value                                │
│     └─ NO  ↓                                                │
│                                                             │
│  2. defaultTitle is configured?                             │
│     ├─ YES → Use defaultTitle (query supported)             │
│     └─ NO  ↓                                                │
│                                                             │
│  3. Fallback: Page Title + Separator + Site Title           │
│     → "About Us – My Website"                               │
│                                                             │
└─────────────────────────────────────────────────────────────┘

```

### Description Resolution

[](#description-resolution)

The preview description is determined in this order:

```
┌─────────────────────────────────────────────────────────────┐
│                                                             │
│  1. descriptionContentKey field has value?                  │
│     ├─ YES → Use field value                                │
│     └─ NO  ↓                                                │
│                                                             │
│  2. defaultDescription is configured?                       │
│     ├─ YES → Use defaultDescription (query supported)       │
│     └─ NO  → No description shown                           │
│                                                             │
└─────────────────────────────────────────────────────────────┘

```

Custom Formatters
-----------------

[](#custom-formatters)

You can transform the title and description before they are displayed using custom formatters. This is useful for truncating text, removing HTML, or applying other transformations.

```
// site/config/config.php
return [
    'johannschopplich.serp-preview' => [
        'formatters' => [
            'title' => function (string $value, \Kirby\Cms\Page $page) {
                // Example: Limit title length
                return Str::short($value, 60);
            },
            'description' => function (string $value, \Kirby\Cms\Page $page) {
                // Example: Strip HTML and limit length
                return Str::short(strip_tags($value), 160);
            }
        ]
    ]
];
```

The formatter receives the current value and the page object, allowing page-specific transformations.

License
-------

[](#license)

[MIT](./LICENSE) License © 2023-PRESENT [Johann Schopplich](https://github.com/johannschopplich)

[MIT](./LICENSE) License © 2023 [Dennis Baum](https://github.com/dennisbaum)

###  Health Score

45

—

FairBetter than 93% of packages

Maintenance71

Regular maintenance activity

Popularity31

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity52

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 98.4% 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 ~24 days

Recently: every ~105 days

Total

23

Last Release

364d ago

Major Versions

0.5.1 → 1.0.02024-03-17

### Community

Maintainers

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

---

Top Contributors

[![johannschopplich](https://avatars.githubusercontent.com/u/27850750?v=4)](https://github.com/johannschopplich "johannschopplich (124 commits)")[![grommasdietz](https://avatars.githubusercontent.com/u/136818759?v=4)](https://github.com/grommasdietz "grommasdietz (2 commits)")

---

Tags

kirby-cmskirby-pluginkirby-themekirby4kirby5googleseosearch engineSERPkirby

### Embed Badge

![Health badge](/badges/johannschopplich-kirby-serp-preview/health.svg)

```
[![Health](https://phpackages.com/badges/johannschopplich-kirby-serp-preview/health.svg)](https://phpackages.com/packages/johannschopplich-kirby-serp-preview)
```

###  Alternatives

[arcanedev/seo-helper

SEO Helper is a framework agnostic package that provides tools &amp; helpers for SEO (Laravel supported).

332467.0k4](/packages/arcanedev-seo-helper)[fabianmichael/kirby-meta

Your all-in-one powerhouse for any SEO and metadata needs imaginable.

6910.7k1](/packages/fabianmichael-kirby-meta)[johannschopplich/kirby-helpers

Environment, SEO, and build utilities for Kirby CMS

277.4k](/packages/johannschopplich-kirby-helpers)[withcandour/aardvark-seo

Save time and get your Statamic site to rank better with the SEO addon for Statamic.

13128.3k](/packages/withcandour-aardvark-seo)[johannschopplich/kirby-seo-audit

SEO analysis powered by Yoast for Kirby CMS

102.3k](/packages/johannschopplich-kirby-seo-audit)[moritzebeling/kirby-favicon

Kirby plugin to meet all favicon needs

144.8k](/packages/moritzebeling-kirby-favicon)

PHPackages © 2026

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