Content Strategy & SEO

DFinberg
Member

Want to show different meta title for case studies

We want to display a different meta title for case studies entries. While we have the option to control the case studies title, there is currently no option to set a separate meta title. Is there a way to achieve this customization?

0 Upvotes
5 Replies 5
hkyles58
Member

Want to show different meta title for case studies

To display different meta titles for case studies, you can dynamically generate them to enhance SEO and user engagement. A good format could be {Case Study Title} | Vist Success Story | YourBrand. Click Here to explore more success stories. If you're using a CMS, implement a dynamic meta title setup in your template to automate this process and maintain consistency.

0 Upvotes
albertsg
Guide

Want to show different meta title for case studies

Hi @DFinberg, you can achieve this by updating your template (at code level, so you might need a developer if you are not familiar with HubL and HTML).

First you need a new text variable in the template you are using for Case Studies, something like:

 

 

 

{% text "case_study_title" label="Enter custom meta title here", value="", export_to_template_context=True %}

 

 

 

Then, go to you base.html (or the file where you have the <head> element, and add the following:

 

 

 

{% if content.widgets.case_study_title.body.value != '' %}
    <title>{{content.widgets.case_study_title.body.value}}</title>
{% else %}
    {% if page_meta.html_title or pageTitle %}<title>{{ page_meta.html_title or pageTitle }}</title>{% endif %}
{% endif %}

 

 


The code above will overwrite the meta title with whatever text you add to the variable that you added to the template and that will appears in the sidebard when editing a page that uses that template. If the value is empty, then your page title will be used as meta title. 

If you need futher help, please let me know 🙂



Did my answer help you? Mark it as a solution
0 Upvotes
DFinberg
Member

Want to show different meta title for case studies

Thanks @albertsg for the response. We are using the built-in case studies section of hubspot and the template associated with it dont have the option to edit. We have tried to overwrite it using child theme as well but it wont work. Is there any other solution?

0 Upvotes
Jigar_Thakker
Key Advisor | Diamond Partner
Key Advisor | Diamond Partner

Want to show different meta title for case studies

Hi @DFinberg

While HubSpot allows you to set the page title and meta description, it currently uses the page title as the meta title.

If you're looking to display a separate meta title in search engine results that differs from the title shown on the case study page itself, this functionality might not be directly available in HubSpot. However, you can still manage the meta description for search results and optimize the page title for SEO purposes. For further customization, you can further go by exploring custom coding through HubSpot’s CMS Hub features to manually set metadata or try using HubSpot API’s.

For additional guidance, you can refer to this resource here.

If this helps, feel free to mark it as the solution ✔️ 
and give it an upvote 👍 !

0 Upvotes
DFinberg
Member

Want to show different meta title for case studies

Thanks for your reply @Jigar_Thakker Can you share/suggest any link or support article regarding using HubSpot’s CMS Hub features or HubSpot API which will allow this custom feature? The article you mentioned in the reply not suggest anything related to separate meta title. 

0 Upvotes