How do you tell Kirby if a page should have a translation or not?

I’m trying to tho this with a Kirby v1 Website but I don’t see how it’s possible in v1 or v2 and I assume that the way to get it done might be similar in both.

Consider this scenario: You’ve got your multilingual Website but you have more Content for the main(default) language than the others. How do you tell Kirby if a page should have a translation or not?

The default situation is that every single page exists in every activated language. But I can imagine lots of situation where you don’t want this to be the case. How can I have Pages A,B and C in the default language but only deliver A and B in a secondary one?

Am I missing sth very obvious? … I couldn’t find anything in the docs in regards to this situation.

Thanks a lot

As far as I’m aware: At the moment, Kirby simply takes the default language values for all pages, if not translation exists for the current language.

I don’t think that there is an option to filter and deliver only the pages that have been translated. But I agree, I’d also find such an option very useful and hope to realize that sooner than later (whether this be in the core or as a plugin).

I know this is somehow possible, in Kirby 1 it was quite complicated to filter out the content and only show the stuff in a particular language. I did that once for my personal blog where I didn’t want the English version to display all the German default articles.I think its a bit easier in K2 but I can’t remember how … need to check that.

[Edit] I think the easiest way is still to add a language field to every page and then filter according to that field. Although $page->content($languagecode) might come in handy as well, not sure though.

Yeah, that’s what it does. … If that could somehow be turned off, that would be great. Then you could be able to manually add those pages that you wish to translate.

Or it would be great already if the visibility of the pages could be toggled independently.

I only made one multilingual kirbypage so far and there I didn’t need it. But it seems like such a basic feature to me that I can’t quite grasp how it’s not available.

Well, Kirby does not automatically translate pages. If you switch to another language in the panel, then the default values are shown but no text file is created as long as you don’t hit the save button. What is does by default, is show the default language if no translation exists, though.

Yes, I know. But it should be possible to not have that happen. Somehow it has to be possible to have pages in one language but not another.

e: In a rather simple way…

This custom filter for blog articles works for me

$articles = $page->children()->visible()->filter(function($child) {
     return site()->language()->code() == $child->language()->code();

I don’t fully understand what’s going on there but I’ll try it anyhow. Do you use that on the v1 Site or will it only work on v2?

Thanks already!

That’s K2 only, don’t think K1 supports callbacks on the filter() method. If you are interested in my solution for K1, check out this old post

1 Like

I didn’t think of this, @texnixe. Great stuff, thanks for sharing :smile:

Here’s the filter incorporating @texnixe’s helpful input:

// Anything that matches a given language attribute
collection::$filters['languageIs'] = function($collection, $field, $value) {

  foreach($collection->data as $key => $item) {
    if (collection::extractValue($item->content()->language(), $field) != $value) {

  return $collection;


Add this to your site/plugin/filters.php and use the following in your templates:

$articles = $page->children()->visible()->filterBy('code', 'languageIs', 'ja');


1 Like