seo json override meta description Jahia 8.2

Increasing the meta description character limit

Question

Since Jahia 8.2, the site-settings-seo module enforces a 160-character limit on the meta description field in the content editor. This limit can be overridden at the module level.

Answer

Create two JSON override files in your module under META-INF/jahia-content-editor-forms/forms/, one for each affected node type:
 

  • jmix_mainResource_rename_description.json
  • jnt_page_rename_description.json
     

In each file, set maxLength to the desired value (here 200), with a sufficiently high priority (e.g. 3.0):

{
  "nodeType": "jmix:mainResource",
  "priority": 3.0,
  "sections": [
    {
      "name": "seo",
      "hide": false,
      "fieldSets": [
        {
          "name": "htmlHead",
          "labelKey": "site-settings-seo:seo.htmlHeadSection.label",
          "rank": 0.1,
          "fields": [
            {
              "name": "jcr:description",
              "declaringNodeType": "jmix:description",
              "labelKey": "site-settings-seo:seo.metaDescription.label",
              "descriptionKey": "site-settings-seo:seo.metaDescription.ui.tooltip",
              "selectorOptionsMap": {
                "maxLength": 200
              }
            },
            {
              "name": "seoKeywords",
              "declaringNodeType": "jmix:seoHtmlHead"
            },
            {
              "name": "openGraphImage",
              "declaringNodeType": "jmix:seoHtmlHead"
            }
          ]
        },
        {
          "name": "jmix:seoHtmlHead",
          "rank": 0.2,
          "isAlwaysActivated": true,
          "alwaysPresent": true,
          "hide": true
        }
      ]
    }
  ]
}

Repeat with "nodeType": "jnt:page" in the second file.

And you can also update the properties file:

seo.metaDescription.ui.tooltip=The Meta description tag is very important for your SEO. Keep it simple and informative. Best practice is to limit the description to 160 characters but the effective limit is set to 200.