Knowledge Base Tool

ThomasSchädlich
Participant

Mass-updating knowledge base article meta descriptions

SOLVE

Hello, we are currently migrating our knowledge base to HubSpot. So far, we could not find any way to import the meta descriptions for our articles:

  • The API does not accept meta descriptions.
  • There is no workflow action to update the knowledge base article object.
  • Make does not offer a module to update knowledge base articles at all.

Is there anyone who can think of a solution? We are talking hundreds of articles, so an automated solution is highly appreciated.

 

Thank you for your help!

0 Upvotes
1 Accepted solution
GIlievski
Solution
Top Contributor | Diamond Partner
Top Contributor | Diamond Partner

Mass-updating knowledge base article meta descriptions

SOLVE

Hey @ThomasSchädlich,

 

Here is what our friend Gemini suggests for the Header HTML and I mostly agree 😀

Make sure you replace the values for the table ID and check if "exact" is the right filter for the hubdb_table_rows.

 

{% set hubdb_table_id = "your_table_id_or_name" %}
{% set column_to_match = "article_slug" %}
{% set column_with_meta_desc = "meta_description" %}

{# Fetch the specific row from the HubDB table where the slug matches the current article's slug #}
{% set hubdb_row = hubdb_table_rows(hubdb_table_id, "exact", column_to_match, content.slug) %}

{# Check if a matching row was found in the HubDB table #}
{% if hubdb_row %}
  {# A row was found, so we use the meta description from that row #}
  <meta name="description" content="{{ hubdb_row[0][column_with_meta_desc]|escape_html }}">
{% else %}
  {# FALLBACK: If no row is found, use the default meta description from the article's settings, or a truncated summary #}
  {% if content.meta_description %}
    <meta name="description" content="{{ content.meta_description|escape_html }}">
  {% elif content.post_summary %}
    <meta name="description" content="{{ content.post_summary|striptags|truncate(160)|escape_html }}">
  {% endif %}
{% endif %}

 Your HubDB table would have 2 columns (Article Slug and Meta Description).

 

So if your article is www.website.com/knowledgebase/article-1 and your HubDB table has a row where the first column "Article Slug" is "article-1" it should pull the second column "Meta Description". 

 

I am not sure again it will all work and if the "fallback" will work with pulling from the content.post_summary.



Goran Ilievski
Senior Development and CRM Lead @ Synx

goran@synx.com.au

synx.com.au

View solution in original post

0 Upvotes
6 Replies 6
GIlievski
Top Contributor | Diamond Partner
Top Contributor | Diamond Partner

Mass-updating knowledge base article meta descriptions

SOLVE

Hey @ThomasSchädlich,

 

Not sure if possible but the only possibility I can think of is HubDB + Hubl/JS in the header.

 

Import your meta descriptions in a HubDB table then pull them into the template Header HTML. If you do succeed then probably best to keep managing net new via HubDB, which would not be the worst outcome.

 

Hope that helps.



Goran Ilievski
Senior Development and CRM Lead @ Synx

goran@synx.com.au

synx.com.au
ThomasSchädlich
Participant

Mass-updating knowledge base article meta descriptions

SOLVE

Hi @GIlievski, thanks for your effort. Sorry but can you explain in more detail? I am not much into HubDB so far.

0 Upvotes
GIlievski
Solution
Top Contributor | Diamond Partner
Top Contributor | Diamond Partner

Mass-updating knowledge base article meta descriptions

SOLVE

Hey @ThomasSchädlich,

 

Here is what our friend Gemini suggests for the Header HTML and I mostly agree 😀

Make sure you replace the values for the table ID and check if "exact" is the right filter for the hubdb_table_rows.

 

{% set hubdb_table_id = "your_table_id_or_name" %}
{% set column_to_match = "article_slug" %}
{% set column_with_meta_desc = "meta_description" %}

{# Fetch the specific row from the HubDB table where the slug matches the current article's slug #}
{% set hubdb_row = hubdb_table_rows(hubdb_table_id, "exact", column_to_match, content.slug) %}

{# Check if a matching row was found in the HubDB table #}
{% if hubdb_row %}
  {# A row was found, so we use the meta description from that row #}
  <meta name="description" content="{{ hubdb_row[0][column_with_meta_desc]|escape_html }}">
{% else %}
  {# FALLBACK: If no row is found, use the default meta description from the article's settings, or a truncated summary #}
  {% if content.meta_description %}
    <meta name="description" content="{{ content.meta_description|escape_html }}">
  {% elif content.post_summary %}
    <meta name="description" content="{{ content.post_summary|striptags|truncate(160)|escape_html }}">
  {% endif %}
{% endif %}

 Your HubDB table would have 2 columns (Article Slug and Meta Description).

 

So if your article is www.website.com/knowledgebase/article-1 and your HubDB table has a row where the first column "Article Slug" is "article-1" it should pull the second column "Meta Description". 

 

I am not sure again it will all work and if the "fallback" will work with pulling from the content.post_summary.



Goran Ilievski
Senior Development and CRM Lead @ Synx

goran@synx.com.au

synx.com.au
0 Upvotes
ThomasSchädlich
Participant

Mass-updating knowledge base article meta descriptions

SOLVE

I'll give it a shot, thank you!

0 Upvotes
ThomasSchädlich
Participant

Mass-updating knowledge base article meta descriptions

SOLVE

Ah, sorry I was a little misinformed. We are using the build-in import tool for knowledge bases, not the API.

Thanks for sharing your experience @TomM2.

0 Upvotes
TomM2
Thought Leader | Platinum Partner
Thought Leader | Platinum Partner

Mass-updating knowledge base article meta descriptions

SOLVE

Hey @ThomasSchädlich could you provide a link to the api you're looking at? To my knowledge there is no Knowledgebase api, but hopefully this has been updated! 

 

If there is no api however it would also explain why make don't have an integration, because there's no way to do this. 

We went through the same issue with a customer last year and unfortunately the only solution was to manually update every KB article, we couldn't set any meta info from the import, including language variants. So it was just a case of getting very organised and having a few of us sprint at it over the course of a day or so. 

Tom Mahon
Technical Consultant | Solutions Engineer | Community Champion
Baskey Digitial

Book a consultation

Did my post help answer your query? Help the community (and me) by marking it as a solution.


0 Upvotes