The following options can be set in your /site/config/config.php
file:
Default values
c::set('plugin.serp.active', true);
c::set('plugin.serp.fallback.title', $title_missing);
c::set('plugin.serp.fallback.description', $description_missing);
c::set('plugin.serp.limit', 10);
c::set('plugin.serp.panel', 'panel');
c::set('plugin.serp.prefix', 'serp');
c::set('plugin.serp.url', 'serp');
The plugin is active by default, but if you want to deactivate it you can by setting this option to false
.
By default all pages on your site will be used in Kirby Serp and sorted alphabetically. You can set your own collection if you want.
If the title is missing this it will be set by default.
No title tag found! A title tag should be below 600px wide.
If the description is missing this it will be set by default.
No meta description found! A meta description tag should be around 155 characters. Search engines choose if they want to use it or not.
On each page, 10 items is listed by default. You can change this if you want.
Tell the plugin where the panel is located in order to be able to edit the title and description in the Panel.
The prefix is used for the snippet names. If you already use serp
as prefix for another reason, you can change that prefix.
By default this tool will run at YOUR_DOMAIN/serp
but you can change it if you need to.
All the filter options work in a similar way.
Default values
c::set('plugin.serp.filter.collection', function($args){ return $data['args']; }); // Array
c::set('plugin.serp.filter.title', function($args){ return $data['args']; }); // String
c::set('plugin.serp.filter.description', function($args){ return $data['args']; }); // String
c::set('plugin.serp.filter.url', function($args){ return $data['args']; }); // String
c::set('plugin.serp.filter.uri', function($args){ return $data['args']; }); // String
c::set('plugin.serp.filter.panel', function($args){ return $data['args']; }); // String
c::set('plugin.serp.filter.flag', function($args){ return $data['args']; }); // String
c::set('plugin.serp.filter.query', function($args){ return $data['args']; }); // Collection
Filter the array of a single collection item.
title
is the seo titledescription
is the seo descriptionurl
is the url of the pageuri
is the visible version of the urlpanel
is the full panel urlflag
is different kind of statuses likesuccess
,danger
andwarning
.
c::set('plugin.serp.filter.collection', function($args) {
return $args['data']; // Array
});
The seo title of a single page. By default $page->seo_title()
is used.
c::set('plugin.serp.filter.title', function($args) {
return $args['data']; // String
});
The seo meta description of a single page. By default $page->seo_description()
is used.
c::set('plugin.serp.filter.description', function($args) {
return $args['data']; // String
});
The url of the page. This filter is especially useful for routed urls.
c::set('plugin.serp.filter.url', function($args) {
return $args['data']; // String
});
The visible version of the url.
c::set('plugin.serp.filter.uri', function($args) {
return $args['data']; // String
});
The full panel url.
c::set('plugin.serp.filter.panel', function($args) {
return $args['data']; // String
});
It's different kind of statuses like success
, warning
and danger
.
success
means that both seo title and seo meta description is not empty.warning
means that the meta description is empty but the title has content.danger
means that the seo title is empty.
c::set('plugin.serp.filter.flag', function($args) {
return $args['data']; // String
});
The query to get the pages by. By default this query is used:
site()->index()->visible()->flip()->sortBy('id', 'asc');
The option looks like this:
c::set('plugin.serp.filter.query', function($args) {
return $args['data']; // Collection
});
It's possible to use Kirby SEO with this plugin. The setup in the config.php
would be something like this:
c::set('plugin.serp.filter.title', function($args) {
$controller = SeoCore::panel( $args['page'] );
$content = $controller['title']['full-replaced'];
return $content;
});
c::set('plugin.serp.filter.description', function($args) {
$controller = SeoCore::panel( $args['page'] );
$content = $controller['description']['full-replaced'];
return $content;
});