<p>So it looks like you're using the old syntax for SEOmatic 1.x for Craft 2.x; here's how you do the same thing in SEOmatic for Craft 3:</p>

<pre><code>{% do seomatic.meta.seoTitle("Some Title") %}
</code></pre>

<p>c.f.: <a href="https://github.com/nystudio107/craft-seomatic#twig-templating" rel="nofollow noreferrer">https://github.com/nystudio107/craft-seomatic#twig-templating</a></p>

CC BY-SA 4.0
2018-08-15T14:15:04.797Z
sorry about that I was using the old syntax
Jeroen
CC BY-SA 4.0
2018-12-28T13:15:03.107Z
actually this doesn't work for a 404.twig in the templates folder
Jeroen
CC BY-SA 4.0
2018-12-28T17:37:58.500Z
Are you sure? I'm setting it that way here: https://nystudio107.com/404
andrew.welch
CC BY-SA 4.0
2019-02-12T10:07:07.323Z
Looks like the title is only updating after save some Seomatic settings page.
Jeroen
CC BY-SA 4.0
2020-04-20T15:14:23.013Z
@Jeroen Saving a settings page clears the caches. So it sounds like you're making Twig templating changes in an environment with `devMode` off, or you're not clearly caches on deploy.
andrew.welch
CC BY-SA 4.0
2020-04-21T12:41:35.780Z
Hi @andrew.welch I know this is an old question but it appears there is something still strange going on with a 404 page title. In the instance of a 404, seomatic.meta.seoTitle can end up with a value even though entry is not defined and its not been manually set.

You can see it here is different to your 404 page example: https://nystudio107.com/404test
Jay
CC BY-SA 4.0
2018-08-15T13:15:12.847Z
2018-08-15T13:15:12.847Z
andrew.welch
<p>404 page doesn't have a title. It shows "| Sitename" in my case.</p>

<p>I'm using Craft 3 with the <a href="https://github.com/nystudio107/seomatic" rel="nofollow noreferrer">SEOmatic</a> plugin and would like to set the title in the 404 template.</p>

<pre><code>{% set seomaticMeta = seomaticMeta | merge({ seoTitle: '404 page not found' }) %}
</code></pre>

<p>This gives a internal server error, looks like the seomaticMeta object is not available on the 404 page.</p>

<craft3><plugin-seomatic><404-page>
404 page title SEOmatic
# 404 page title SEOmatic

(Asked by: username_0 on 2018-08-15)

404 page doesn't have a title. It shows "| Sitename" in my case.
I'm using Craft 3 with the SEOmatic plugin and would like to set the title in the 404 template.
{% set seomaticMeta = seomaticMeta | merge({ seoTitle: '404 page not found' }) %}

This gives a internal server error, looks like the seomaticMeta object is not available on the 404 page.

**Tags:** craft3, plugin-seomatic, 404-page

---

## 1 answers

### Answer by username_1 on 2018-08-15. Score: 3 | Accepted answer

So it looks like you're using the old syntax for SEOmatic 1.x for Craft 2.x; here's how you do the same thing in SEOmatic for Craft 3:
{% do seomatic.meta.seoTitle("Some Title") %}

c.f.: https://github.com/nystudio107/craft-seomatic#twig-templating

> **Comments:**
> **username_0**: sorry about that I was using the old syntax  
> **username_0**: actually this doesn't work for a 404.twig in the templates folder  
> **username_1**: Are you sure? I'm setting it that way here: https://nystudio107.com/404  
> **username_0**: Looks like the title is only updating after save some Seomatic settings page.  
> **username_1**: @Jeroen Saving a settings page clears the caches. So it sounds like you're making Twig templating changes in an environment with `devMode` off, or you're not clearly caches on deploy.  
> **username_2**: Hi @andrew.welch I know this is an old question but it appears there is something still strange going on with a 404 page title. In the instance of a 404, seomatic.meta.seoTitle can end up with a value even though entry is not defined and its not been manually set.  You can see it here is different to your 404 page example: https://nystudio107.com/404test  

---

