Purchase a License

A license is priced per website with no ongoing costs.

Optimising Meta With 1.6.0

With v1.6, Chirp will allow you to take control of meta once and for all. Quite often as a developer, I had a standard set of page attributes that I used for every project, then had to go and copy across and then incrementally make updates whenever my template changed. I wanted one central app to control meta no matter if the page was powered by Pages, Blog or a Collection.

Here’s a sneak preview as to how things work in v1.6…

New page functions

<?php
    if (perch_layout_var(‘type’, true) == ‘post’) {
      chirp_seo_blog_attributes(perch_get(’s’));
    } else {
      chirp_seo_page_attributes();
    }
  ?>

And this will automatically pick up values from the page, and create the following associated meta.

<title>The Complete Perch SEO App - SEO Analysis | Chirp</title>
<meta name=“description” content=“Chirp allows content editors to analyse their content, and improve their on-site SEO. Find out how well your website is performing in terms of on-site SEO.” />
<link href=“https://grabachirp.com” rel=“home”>
<link rel=“canonical” href=“http://chirp.test/“>
<meta property=“og:locale” content=“en-gb” />
<meta property=“og:site_name” content=“Chirp SEO”>
<meta property=“og:url” content=“http://chirp.test/“>
<meta property=“og:title” content=“”>
<meta property=“og:description” content=“”>
<meta property=“og:type” content=“website”>
<meta name=“twitter:card” content=“summary”>
<meta name=“twitter:site” content=“@grabachirp”>
<meta name=“twitter:title” content=“”>
<meta name=“twitter:description” content=“”>
<meta name=“twitter:url” content=“http://chirp.test/“>

<script type=“application/ld+json”>{ 
   “@context”:”https://schema.org”,
   “@graph”:[ 
      { 
         “@type”:”Organization”,
         “@id”:”https://grabachirp.com#organization”,
         “name”:”Chirp SEO”,
         “url”:”https://grabachirp.com”,
         “logo”:{ 
            “@type”:”ImageObject”,
            “url”:”https://grabachirp.com”
         }
      },
      { 
         “@type”:”WebSite”,
         “@id”:”https://grabachirp.com#website”,
         "url":"https://grabachirp.com",
         "name":"Chirp SEO",
         "publisher":{ 
            "@id":"https://grabachirp.com#organization"
         }
      },
      { 
         “@type”:”WebPage”,
         “@id”:”http://chirp.test/#webpage”,
         “url”:”http://chirp.test/“,
         "inLanguage":"en-gb",
         "name":"",
         "isPartOf":{ 
            "@id":"http://chirp.test/#website"
         },
         "about":{ 
            "@id":"http://chirp.test/#organization"
         },
         "primaryImageOfPage":{ 
            "@id":"http://chirp.test/#primaryimage"
         },
         "description":""
      }
   ]
}</script>

Of course, often in projects you might want to override custom defaults, so we’ve provided an easy way to override…

chirp_seo_page_attributes([
    ‘title’ => ‘My new title’
]);

This will update the template to update the page title. You can update an any of the following values:

  • page_url
  • title
  • description
  • og_title
  • og_description
  • og_image
  • twitter_name
  • domain
  • sitename
  • lang
  • og_type
  • author
  • date_published
  • date_modified
  • publisher_logo

This comes in super handy when a page is powered by a collection. You can do something like the following:

$events = perch_collection(‘Events’, [
    ‘filter’ => ‘slug’,
    ‘match’ => ‘eq’,
    ‘value’ => perch_get(’s’)
], true);

$event = $events[0];

chirp_seo_page_attributes([
    ‘title’ => $event[‘title’],
    ‘description’ => $event[‘description’],
]);

I am open to feedback on how better to support Collections, but for now the Chirp API allows developers to customise meta super easily.

Blog Support

A blog is a very common part of a lot of Perch sites. We’ve made sure it’s easy to support Perch Blog too…

chirp_seo_blog_attributes(perch_get(’s’));

Once again, we’ll do all the hard work for you and pull what we think is the most appropriate default fields for each of the meta values. Like Pages, you can just override any value you want at anytime! Oh, and you’ll get some Article schema:

  <script type="application/ld+json">
  {
    "@context": "https://schema.org",
    "@type": "NewsArticle",
    "mainEntityOfPage": {
      "@type": "WebPage",
      "@id": "https://google.com/article"
    },
    "headline": "Announcing Chirp 4.0 & Chirp Web App",
    "image": [
      "https://grabachirp.com/admin/resources/grabachirpcomanalyselaptop-with-hidpi-screen-1.png"
    ],
    "datePublished": "2018-10-08T0:00:00.000000+0000",
    "dateModified": "2018-10-08T0:00:00.000000+0000",
    "author": {
      "@type": "Person",
      "name": "Ryan Gittings"
    },
    "publisher": {
      "@type":"Organization",
      "@id":"https://grabachirp.com#organization",
      "name":"Chirp SEO",
      "url":"https://grabachirp.com",
      "logo": {
        "@type": "ImageObject",
        "url": "https://grabachirp.com/admin/resources/logo-1.png"
      }
    },
    "description": "<p>Today we’re very excited to launch one big update and one new product.</p>"
  }
  </script>

Page OG Template

We know support OG in templates can be a bit of a pain. We’ve created a template so you don’t have to. You can just add the following to your pages/attributes/default.html to support Open Graph tags! Copy the chirp_seo/templates/chirp folder to templates/chirp/.

<perch:template path="chirp/seo.html" rescope="parent" />

Entering Beta

We’re launching beta of v1.6 very soon. If you’re interested in testing, please pop us an email and we’ll get you a copy! We’re very much looking for feedback on how you work with meta, and how we can improve Chirp to make working with meta much easier.

Signup to our list

Receive the latest news, offers and updates right in your mailbox.