# Accessing content.keyword section for pages

**URL:** <https://community.hubspot.com/t/accessing-content-keyword-section-for-pages/20388>\
**Category:** CMS Development\
**Created:** [April 27, 2020, 9:33am UTC](https://community.hubspot.com/t/accessing-content-keyword-section-for-pages/20388 "2020-04-27T09:33:19Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![FabianRichter](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/fabianrichter/32/79091_2.png) [@FabianRichter](https://community.hubspot.com/u/FabianRichter)\
**Post date:** [April 27, 2020, 9:33am UTC](https://community.hubspot.com/t/accessing-content-keyword-section-for-pages/20388/1 "2020-04-27T09:33:19Z")

</div>

Hi,  
currently I am working on a solution to add automatically related content from our website (not only related blog posts) into a related content carousel. At this moment this module works with selecting following functionality:

- related blog posts (dynamically) or
- recent blog posts (dynamically) and not required
- related pages (manually, like pillar pages, white papers, event pages)

At this point I started thinking about adding related pages also dynamically by keywords/tags as it works on the blog. My first idea was to use the meta-keyword functionality, wich is not the best solution for non-developers, but might work. So I started to fill the additional head html under advanced website settings with the meta key

`<meta name="keywords" content="dispatching, test">`

This way I could access the keywords in my modules. But I feel like this is a bit dirty and I asked myself if it would be possible to insert the unused JSON-branches like content.keywords, content.meta\_keywords, … I found in the developer infos, which are empty or null. I would also appreciate a suggestion to make the keywords-input easier for content editors - even if we could input the keywords by adding them into a module. Any ideas are welcome!  
Thanks in advance!  
Fabian

---

<div class="post-metadata">

**Author:** ![sharonlicari](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/sharonlicari/32/101479_2.png) [@sharonlicari](https://community.hubspot.com/u/sharonlicari)\
**Post date:** [May 6, 2020, 8:49am UTC](https://community.hubspot.com/t/accessing-content-keyword-section-for-pages/20388/2 "2020-05-06T08:49:04Z")

</div>

Hey @FabianRichter

Thank you for the information provided. I’ll tag a few of our experts that can share their knowledge with you.

Hey @Anton @Reg @dennisedson could you please share your thoughts with @FabianRichter?

Thank you

Sharon

---

<div class="post-metadata">

**Author:** ![Anton](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/anton/32/103167_2.png) [@Anton](https://community.hubspot.com/u/Anton)\
**Post date:** [May 6, 2020, 10:27pm UTC](https://community.hubspot.com/t/accessing-content-keyword-section-for-pages/20388/3 "2020-05-06T22:27:07Z")

</div>

Hi @FabianRichter,

to make your content editors lifes easier a possible solution could be:

create a new module(not global) with a single text field(not rich-text) and enable the repeater function in it. I’ve called mine “keyword”

paste following code into the HTML+Hubl(important) section of the module:

```auto
<script>$('head').append( '<meta name="keywords" content="">' );</script>

```

copy the snippet from the text field you’ve created and paste it below the script.

It should look like this:

```auto
<script>$('head').append( '<meta name="keywords" content="">' );</script>
{% for item in module.keyword %}
	{% inline_text field="keyword" value="{{ item }}" %}
{% endfor %}

```

change the code to:

```auto
<script>$('head').append( '<meta name="keywords" content="{% for item in module.keyword %}{ item }}{% endfor %}">' );</script>

```

now your content editors could easily add a keyword per repeater function… **BUT…** there are a few small steps left.

**First:** you’ll have to seperate each keyword from another.  
you can do this by adding a “comma” after the item

`<script>$('head').append( '<meta name="keywords" content="{% for item in module.keyword %}{ item }},{% endfor %}">' );</script>`

**Second/Last:** you’ll have to put the module into the template. There are several ways to achieve this. If you’re using the drag&drop template builder simply add it to the footer section of each template. If you’re using html templates, copy the module snippet.

best,  
Anton

---

<div class="post-metadata">

**Author:** ![FabianRichter](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/fabianrichter/32/79091_2.png) [@FabianRichter](https://community.hubspot.com/u/FabianRichter)\
**Post date:** [May 7, 2020, 8:15am UTC](https://community.hubspot.com/t/accessing-content-keyword-section-for-pages/20388/4 "2020-05-07T08:15:04Z")

</div>

Hi @Anton,  
that sounds really good. I will try that and give you a response soon.  
Thank you!  
Fabian
