Jump to content

Google structured data


RobGielen

Recommended Posts

Hello All,

 

Per Google Guidelines, it is advised to add a small script to your FAQ page.

https://developers.google.com/search/docs/guides/intro-structured-data

See example:

<script type="application/ld+json">
{
  "@context": "https://schema.org",
  "@type": "FAQPage",
  "mainEntity": {
    "@type": "Question",
    "name": "What is FAQ PAGE",
    "acceptedAnswer": {
      "@type": "Answer",
      "text": "Answer to the FAQ PAGE"
    }
  }
}
</script>

Maybe best option to go for module like: https://www.whmcsthemes.com/whmcs-addons/seo-manager/ ?

How would I be able to add this script in the background of a knownledgebase article?

Link to comment
Share on other sites

In my opinion there is no point in implementing this script to WHMCS. Similarly I see no benefit in adding meta tags. Improvements would be laughable or non-existent. You need more than just a snippet and bunch of meta tags to improve your ranking on search engines.

Before you can make use of meta tags and snippets, first you'll things like:

  • Sitemap generator
  • Canonical URLs to avoid duplicated-contents
  • Unique titles, meta descriptions
  • A lot of "noindex, follow" meta robots
  • OG Tag support (url, type, title, description, image)
  • SEO-Friendly URLs
  • Protection from  black hat SEO
  • Pagination and any tag-based category require further attention

All things I listed above must support multi-language otherwise it's like shoot yourself in the foot (WHMCS doesn't support it). It would be great if we could just copy/paste a snippet and write a couple of descriptions to see notable improvements but in reality it's more complicated.

Edited by Kian
Link to comment
Share on other sites

  • 4 years later...

You can add something like this to your template header:
 

<script type="application/ld+json"> 
{
  "@context": "http://schema.org",
  "@graph": [
   { 
        "@type": "Organization",
        "name": "Your Organization Name",
        "logo": "https://example.com/logo.svg",
        "url": "https://example.com"
   }
   {if $kbarticles},
   {
         "@type": "FAQPage",
         "mainEntity": [
         {foreach from=$kbarticles item=kbarticle name=kbarticles}
          {
                "@type": "Question",
                "name": "{$kbarticle.title}",
                "url": "https://whmcs.example.com/{routePath('knowledgebase-article-view', {$kbarticle.id}, {$kbarticle.urlfriendlytitle})}",
                "acceptedAnswer": {
                        "@type": "Answer",
                        "text": "{$kbarticle.article|strip_tags|regex_replace:"/[\r\t\n][\r\t\n]/":""|truncate:120}"
                }
          }{if !$smarty.foreach.kbarticles.last},{else}

         {/if}
         {/foreach}
        ]
    }
  ]
}{/if} 
</script>

 

Link to comment
Share on other sites

  • 10 months later...

Hi ,

You can create schema markup as you want but 3 thinks you can't add pulishdate , modifydate and author because these three information are not added by WHMCS. But you can create two columns in the tblknowledgebase table with default values as the timestamp
on create and for modifydate use update timestamp onupdate 
For the author, you can use the admin name 

For further information or plugin information, reply to me.  because we have a plugin that allows you to do SEO on any page. With this plugin, you also create a product schema. If you need an article schema, we can customize the plugin, then it will generate the article schema automatically, only by selecting the SEO type. No code is needed for that.-
Product scheme and knowledgebase article schema samples are in the attachment
 

Screenshot 2025-05-17 093000.png

Screenshot 2025-05-17 092929.png

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated