<p>The error indicates you're trying to use a Twig filter that <a href="http://twig.sensiolabs.org/doc/filters/index.html" rel="nofollow">doesn't</a> <a href="http://buildwithcraft.com/docs/templating/filters" rel="nofollow">exist</a> in your 404 template at line 4.</p>

<p>Maybe you've got a plugin that added it's own filter, but you don't have the plugin installed or enabled?</p>

<p><strong>Update:</strong></p>

<p>Based on the follow up comments, the error message is very misleading and not sure where it is coming from.  The 404 template doesn't have an <code>entry</code> variable defined, so the solution is to wrap any references to it in:</p>

<pre><code>{% if entry is defined %}
    {{ entry.metaTitle }}
{% endif %}
</code></pre>

CC BY-SA 3.0
2014-12-08T18:30:25.713Z
Thanks for the help, Brad. I think it's the `entry` tags causing issue. Any idea how to fix so that I can use those tags in head? I added code to original post for your reference.
frshjb373
CC BY-SA 3.0
2014-12-08T18:37:05.973Z
Is that code from your `_layout.html` template?
Brad Bell
CC BY-SA 3.0
2014-12-08T18:38:04.193Z
Ya...I'm embedding the head in the `_layout.html`. Added to original post as well.
frshjb373
CC BY-SA 3.0
2014-12-08T18:55:12.203Z
Might as well post global/head, global/header and global/footer, too. :)
Brad Bell
CC BY-SA 3.0
2014-12-08T19:01:40.350Z
Updated original post.
frshjb373
CC BY-SA 3.0
2014-12-08T19:17:47.123Z
If you comment out the calls to `entry.metaTitle`, `entry.metaDescription` and `entry.metaKeywords` in `head.html` does the error go away?
Brad Bell
CC BY-SA 3.0
2014-12-08T19:29:55.917Z
Yes, when I remove that block from head it works.
frshjb373
CC BY-SA 3.0
2014-12-08T19:31:14.487Z
Seems like a misleading error message, then. Try wrapping those calls in `{% if entry is defined %}{% endif %}` blocks.
Brad Bell
CC BY-SA 3.0
2014-12-08T19:37:24.417Z
Need to modify the meta stuff a bit, but it works! Appreciate the help.
frshjb373
CC BY-SA 3.0
2014-12-08T19:47:18.823Z
Really weird... updated my answer in case anyone else runs across this.
Brad Bell
CC BY-SA 3.0
2014-12-08T18:20:37.780Z
2014-12-08T19:46:59.503Z
2014-12-08T19:46:59.503Z
Brad Bell
<p>I created a generic 404.html template to replace the default Craft page. I'm getting the following error when forcing a 404 in browser. Any idea what the issue is?</p>

<pre><code>Twig_Error_Syntax

The filter "match" does not exist. Did you mean "batch" in "404" at line 4 (/Applications/MAMP/htdocs/mysite.com/craft/app/vendor/twig/twig/lib/Twig/ExpressionParser.php:573)

#0 /Applications/MAMP/htdocs/mysite.com/craft/app/vendor/twig/twig/lib/Twig/ExpressionParser.php(437): Twig_ExpressionParser-&gt;getFilterNodeClass('match', 4)
#1 /Applications/MAMP/htdocs/mysite.com/craft/app/vendor/twig/twig/lib/Twig/ExpressionParser.php(422): Twig_ExpressionParser-&gt;parseFilterExpressionRaw(Object(Twig_Node_Expression_GetAttr))
#2 /Applications/MAMP/htdocs/mysite.com/craft/app/vendor/twig/twig/lib/Twig/ExpressionParser.php(287): Twig_ExpressionParser-&gt;parseFilterExpression(Object(Twig_Node_Expression_GetAttr))
#3 /Applications/MAMP/htdocs/mysite.com/craft/app/vendor/twig/twig/lib/Twig/ExpressionParser.php(179): Twig_ExpressionParser-&gt;parsePostfixExpression(Object(Twig_Node_Expression_Name))
#4 /Applications/MAMP/htdocs/mysite.com/craft/app/vendor/twig/twig/lib/Twig/ExpressionParser.php(84): Twig_ExpressionParser-&gt;parsePrimaryExpression()
#5 /Applications/MAMP/htdocs/mysite.com/craft/app/vendor/twig/twig/lib/Twig/ExpressionParser.php(41): Twig_ExpressionParser-&gt;getPrimary()
#6 /Applications/MAMP/htdocs/mysite.com/craft/app/vendor/twig/twig/lib/Twig/TokenParser/If.php(38): Twig_ExpressionParser-&gt;parseExpression()
#7 /Applications/MAMP/htdocs/mysite.com/craft/app/vendor/twig/twig/lib/Twig/Parser.php(187): Twig_TokenParser_If-&gt;parse(Object(Twig_Token))
#8 /Applications/MAMP/htdocs/mysite.com/craft/app/vendor/twig/twig/lib/Twig/Parser.php(95): Twig_Parser-&gt;subparse(NULL, false)
#9 /Applications/MAMP/htdocs/mysite.com/craft/app/vendor/twig/twig/lib/Twig/Environment.php(507): Twig_Parser-&gt;parse(Object(Twig_TokenStream))
#10 /Applications/MAMP/htdocs/mysite.com/craft/app/vendor/twig/twig/lib/Twig/Environment.php(559): Twig_Environment-&gt;parse(Object(Twig_TokenStream))
#11 /Applications/MAMP/htdocs/mysite.com/craft/app/vendor/twig/twig/lib/Twig/Environment.php(334): Twig_Environment-&gt;compileSource('{% extends "_la...', '404')
#12 /Applications/MAMP/htdocs/mysite.com/craft/app/vendor/twig/twig/lib/Twig/Environment.php(292): Twig_Environment-&gt;loadTemplate('404')
#13 /Applications/MAMP/htdocs/mysite.com/craft/app/services/TemplatesService.php(220): Twig_Environment-&gt;render('404', Array)
#14 /Applications/MAMP/htdocs/mysite.com/craft/app/controllers/BaseController.php(74): Craft\TemplatesService-&gt;render('404', Array)
#15 /Applications/MAMP/htdocs/mysite.com/craft/app/controllers/TemplatesController.php(190): Craft\BaseController-&gt;renderTemplate('404', Array)
#16 /Applications/MAMP/htdocs/mysite.com/craft/app/framework/web/actions/CInlineAction.php(49): Craft\TemplatesController-&gt;actionRenderError()
#17 /Applications/MAMP/htdocs/mysite.com/craft/app/framework/web/CController.php(308): CInlineAction-&gt;runWithParams(Array)
#18 /Applications/MAMP/htdocs/mysite.com/craft/app/framework/web/CController.php(286): CController-&gt;runAction(Object(CInlineAction))
#19 /Applications/MAMP/htdocs/mysite.com/craft/app/framework/web/CController.php(265): CController-&gt;runActionWithFilters(Object(CInlineAction), Array)
#20 /Applications/MAMP/htdocs/mysite.com/craft/app/framework/web/CWebApplication.php(282): CController-&gt;run('renderError')
#21 /Applications/MAMP/htdocs/mysite.com/craft/app/framework/base/CErrorHandler.php(331): CWebApplication-&gt;runController('templates/rende...')
#22 /Applications/MAMP/htdocs/mysite.com/craft/app/framework/base/CErrorHandler.php(204): CErrorHandler-&gt;render('error', Array)
#23 /Applications/MAMP/htdocs/mysite.com/craft/app/etc/errors/ErrorHandler.php(113): CErrorHandler-&gt;handleException(Object(Craft\HttpException))
#24 /Applications/MAMP/htdocs/mysite.com/craft/app/framework/base/CErrorHandler.php(129): Craft\ErrorHandler-&gt;handleException(Object(Craft\HttpException))
#25 /Applications/MAMP/htdocs/mysite.com/craft/app/framework/base/CApplication.php(732): CErrorHandler-&gt;handle(Object(CExceptionEvent))
#26 [internal function]: CApplication-&gt;handleException(Object(Craft\HttpException))
#27 {main}
</code></pre>

<p>Template code causing issue:</p>

<pre><code>{!-- META TITLE --}
&lt;title&gt;
    {% if entry.metaTitle != '' %}
        {{entry.metaTitle}}
    {% else %}
        My Site
    {% endif %}
&lt;/title&gt;

{!-- META DESCRPTION --}
{% if entry.metaDescription != '' %}
&lt;meta name="description" content="{{ entry.metaDescription }}"&gt;
{% endif %}

{!-- META KEYWORDS --}
{% if entry.metaKeywords != '' %}
    &lt;meta name="keywords" content="{{ entry.metaKeywords }}"&gt;
{% endif %}
</code></pre>

<p>Here's my <code>_layout.html</code>:</p>

<pre><code>{% include 'global/head.html' %}    

&lt;body&gt;
    &lt;div class="side-push"&gt;
        &lt;div id="wrapper"&gt;
            {% include 'global/header.html' %}  
                {% block home_slider %}
                {% endblock %}
                {% block content %}
                {% endblock %}
            {% include 'global/footer.html' %}      
        &lt;/div&gt;
    &lt;/div&gt;
    &lt;script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"&gt;&lt;/script&gt;
    &lt;script type="text/javascript"&gt;window.jQuery || document.write('&lt;script src="/js/jquery-1.11.1.min.js"&gt;&lt;\/script&gt;')&lt;/script&gt;
    &lt;script type="text/javascript" src="/js/jquery.main.js"&gt;&lt;/script&gt;
&lt;/body&gt;
&lt;/html&gt;
</code></pre>

<p>header.html:</p>

<pre><code>    &lt;header id="header"&gt;
        &lt;div class="header-top"&gt;
            &lt;span class="slogan"&gt;Family Owned Since 1924&lt;/span&gt;
            &lt;div class="logo"&gt;
                &lt;a href="{{ siteUrl }}"&gt;
                    &lt;img src="/images/logo.png" alt="magoon signs"&gt;
                &lt;/a&gt;
            &lt;/div&gt;
        &lt;/div&gt;
        &lt;div class="main-nav"&gt;
            &lt;a href="#" class="opener"&gt;&lt;span&gt;Menu&lt;/span&gt;&lt;/a&gt;
            &lt;nav id="nav"&gt;
                {# get menu items #}
                {% set pageItems = craft.entries.section('services').level('&lt;= 2') %}
                {# % set pageItems = craft.entries.level('&lt;= 2') %# }

                {# Output the sub menu #}
                &lt;ul&gt;
                    &lt;li&gt;&lt;a href="{{ siteUrl }}"&gt;Home&lt;/a&gt;&lt;/li&gt;
                    {% set entry = craft.entries.slug('about').first %}
                    &lt;li&gt;&lt;a href="{{ entry.url }}"&gt;{{ entry.title }}&lt;/a&gt;&lt;/li&gt;

                    {% nav page in pageItems %}
                    &lt;li&gt;
                        &lt;a href="{{ page.navigationUrlOverride ? page.navigationUrlOverride : page.url }}"&gt;
                            {% if page.navigationTitle %}{{ page.navigationTitle|nl2br }}{% else %}{{ page.title }}{% endif %}
                        &lt;/a&gt;
                        {% ifchildren %}
                        &lt;div class="drop"&gt;
                            &lt;ul&gt;
                                {% children %}
                            &lt;/ul&gt;
                        &lt;/div&gt;
                        {% endifchildren %}
                    &lt;/li&gt;
                    {% endnav %}
                &lt;/ul&gt;
                &lt;ul&gt;
                    {% set entry = craft.entries.slug('testimonials').first %}
                        &lt;li&gt;&lt;a href="{{ entry.url }}"&gt;{{ entry.title }}&lt;/a&gt;&lt;/li&gt;
                    {% set entry = craft.entries.slug('contact').first %}
                        &lt;li&gt;&lt;a href="{{ entry.url }}"&gt;{{ entry.title }}&lt;/a&gt;&lt;/li&gt;
                    {% set entry = craft.entries.slug('get-a-quote').first %}
                        &lt;li&gt;&lt;a href="{{ entry.url }}"&gt;{{ entry.title }}&lt;/a&gt;&lt;/li&gt;
                &lt;/ul&gt;
            &lt;/nav&gt;
        &lt;/div&gt;
    &lt;/header&gt;
</code></pre>

<p>footer.html:</p>

<pre><code>    &lt;footer id="footer"&gt;
        &lt;div class="holder"&gt;
            &lt;a href="#" class="badge"&gt;
                &lt;img src="/images/img4.png" alt="image description"&gt;
            &lt;/a&gt;
            &lt;div class="wrap"&gt;
                &lt;ul class="social-networks"&gt;
                    &lt;li&gt;&lt;a class="linkdin" href="#"&gt;linkedin&lt;/a&gt;&lt;/li&gt;
                    &lt;li&gt;&lt;a class="facebook" href="#"&gt;facebook&lt;/a&gt;&lt;/li&gt;
                &lt;/ul&gt;
                &lt;h2&gt;{{ siteName }}&lt;/h2&gt;
                &lt;address&gt;{{ companyInfo.address }}&lt;/address&gt;
                &lt;a class="tel-link" href="tel:{{ companyInfo.phoneNumberLink }}"&gt;{{ companyInfo.phoneNumber }}&lt;/a&gt;
                &lt;span class="timings"&gt;
                    Open: &lt;time datetime="2014-08-21"&gt;Mon.-Fri. 8:30am-4pm&lt;/time&gt; Closed Daily from &lt;time datetime="2014-08-21"&gt;12:00pm-1:00pm&lt;/time&gt;
                &lt;/span&gt;
            &lt;/div&gt;
        &lt;/div&gt;
    &lt;/footer&gt;
</code></pre>

<p>head.html:

</p>

<pre><code>&lt;head&gt;
    &lt;meta charset="utf-8"&gt;
    &lt;meta name="viewport" content="width=device-width, initial-scale=1.0 " /&gt;

    {!-- META TITLE --}
    &lt;title&gt;
        {% if entry.metaTitle != '' %}
            {{entry.metaTitle}}
        {% else %}
            My Site
        {% endif %}
    &lt;/title&gt;

    {!-- META DESCRPTION --}
    {% if entry.metaDescription != '' %}
    &lt;meta name="description" content="{{ entry.metaDescription }}"&gt;
    {% endif %}

    {!-- META KEYWORDS --}
    {% if entry.metaKeywords != '' %}
        &lt;meta name="keywords" content="{{ entry.metaKeywords }}"&gt;
    {% endif %}

    &lt;link href='http://fonts.googleapis.com/css?family=Vast+Shadow' rel='stylesheet' type='text/css'&gt;
    &lt;link media="all" rel="stylesheet" href="/css/all.css"&gt;
    &lt;link rel="stylesheet" href="/css/flexslider.css" type="text/css"&gt;

    &lt;!--[if lt IE 9]&gt;&lt;script src="js/ie.js"&gt;&lt;/script&gt;&lt;![endif]--&gt;
    {% block css_wufoo %}{% endblock %}
    {% block css_fancybox %}{% endblock %}

&lt;/head&gt;
</code></pre>

<templating><error-message><404-page><error-templates>
404.html template causing twig_error_syntax
# 404.html template causing twig_error_syntax

(Asked by: username_0 on 2014-12-08)

I created a generic 404.html template to replace the default Craft page. I'm getting the following error when forcing a 404 in browser. Any idea what the issue is?
Twig_Error_Syntax

The filter "match" does not exist. Did you mean "batch" in "404" at line 4 (/Applications/MAMP/htdocs/mysite.com/craft/app/vendor/twig/twig/lib/Twig/ExpressionParser.php:573)

#0 /Applications/MAMP/htdocs/mysite.com/craft/app/vendor/twig/twig/lib/Twig/ExpressionParser.php(437): Twig_ExpressionParser->getFilterNodeClass('match', 4)
#1 /Applications/MAMP/htdocs/mysite.com/craft/app/vendor/twig/twig/lib/Twig/ExpressionParser.php(422): Twig_ExpressionParser->parseFilterExpressionRaw(Object(Twig_Node_Expression_GetAttr))
#2 /Applications/MAMP/htdocs/mysite.com/craft/app/vendor/twig/twig/lib/Twig/ExpressionParser.php(287): Twig_ExpressionParser->parseFilterExpression(Object(Twig_Node_Expression_GetAttr))
#3 /Applications/MAMP/htdocs/mysite.com/craft/app/vendor/twig/twig/lib/Twig/ExpressionParser.php(179): Twig_ExpressionParser->parsePostfixExpression(Object(Twig_Node_Expression_Name))
#4 /Applications/MAMP/htdocs/mysite.com/craft/app/vendor/twig/twig/lib/Twig/ExpressionParser.php(84): Twig_ExpressionParser->parsePrimaryExpression()
#5 /Applications/MAMP/htdocs/mysite.com/craft/app/vendor/twig/twig/lib/Twig/ExpressionParser.php(41): Twig_ExpressionParser->getPrimary()
#6 /Applications/MAMP/htdocs/mysite.com/craft/app/vendor/twig/twig/lib/Twig/TokenParser/If.php(38): Twig_ExpressionParser->parseExpression()
#7 /Applications/MAMP/htdocs/mysite.com/craft/app/vendor/twig/twig/lib/Twig/Parser.php(187): Twig_TokenParser_If->parse(Object(Twig_Token))
#8 /Applications/MAMP/htdocs/mysite.com/craft/app/vendor/twig/twig/lib/Twig/Parser.php(95): Twig_Parser->subparse(NULL, false)
#9 /Applications/MAMP/htdocs/mysite.com/craft/app/vendor/twig/twig/lib/Twig/Environment.php(507): Twig_Parser->parse(Object(Twig_TokenStream))
#10 /Applications/MAMP/htdocs/mysite.com/craft/app/vendor/twig/twig/lib/Twig/Environment.php(559): Twig_Environment->parse(Object(Twig_TokenStream))
#11 /Applications/MAMP/htdocs/mysite.com/craft/app/vendor/twig/twig/lib/Twig/Environment.php(334): Twig_Environment->compileSource('{% extends "_la...', '404')
#12 /Applications/MAMP/htdocs/mysite.com/craft/app/vendor/twig/twig/lib/Twig/Environment.php(292): Twig_Environment->loadTemplate('404')
#13 /Applications/MAMP/htdocs/mysite.com/craft/app/services/TemplatesService.php(220): Twig_Environment->render('404', Array)
#14 /Applications/MAMP/htdocs/mysite.com/craft/app/controllers/BaseController.php(74): Craft\TemplatesService->render('404', Array)
#15 /Applications/MAMP/htdocs/mysite.com/craft/app/controllers/TemplatesController.php(190): Craft\BaseController->renderTemplate('404', Array)
#16 /Applications/MAMP/htdocs/mysite.com/craft/app/framework/web/actions/CInlineAction.php(49): Craft\TemplatesController->actionRenderError()
#17 /Applications/MAMP/htdocs/mysite.com/craft/app/framework/web/CController.php(308): CInlineAction->runWithParams(Array)
#18 /Applications/MAMP/htdocs/mysite.com/craft/app/framework/web/CController.php(286): CController->runAction(Object(CInlineAction))
#19 /Applications/MAMP/htdocs/mysite.com/craft/app/framework/web/CController.php(265): CController->runActionWithFilters(Object(CInlineAction), Array)
#20 /Applications/MAMP/htdocs/mysite.com/craft/app/framework/web/CWebApplication.php(282): CController->run('renderError')
#21 /Applications/MAMP/htdocs/mysite.com/craft/app/framework/base/CErrorHandler.php(331): CWebApplication->runController('templates/rende...')
#22 /Applications/MAMP/htdocs/mysite.com/craft/app/framework/base/CErrorHandler.php(204): CErrorHandler->render('error', Array)
#23 /Applications/MAMP/htdocs/mysite.com/craft/app/etc/errors/ErrorHandler.php(113): CErrorHandler->handleException(Object(Craft\HttpException))
#24 /Applications/MAMP/htdocs/mysite.com/craft/app/framework/base/CErrorHandler.php(129): Craft\ErrorHandler->handleException(Object(Craft\HttpException))
#25 /Applications/MAMP/htdocs/mysite.com/craft/app/framework/base/CApplication.php(732): CErrorHandler->handle(Object(CExceptionEvent))
#26 [internal function]: CApplication->handleException(Object(Craft\HttpException))
#27 {main}

Template code causing issue:
{!-- META TITLE --}

    {% if entry.metaTitle != '' %}
        {{entry.metaTitle}}
    {% else %}
        My Site
    {% endif %}


{!-- META DESCRPTION --}
{% if entry.metaDescription != '' %}

{% endif %}

{!-- META KEYWORDS --}
{% if entry.metaKeywords != '' %}
    
{% endif %}

Here's my _layout.html:
{% include 'global/head.html' %}    


    
        
            {% include 'global/header.html' %}  
                {% block home_slider %}
                {% endblock %}
                {% block content %}
                {% endblock %}
            {% include 'global/footer.html' %}      
        
    
    
    
    



header.html:
    
        
            Family Owned Since 1924
            
                
                    
                
            
        
        
            Menu
            
                {# get menu items #}
                {% set pageItems = craft.entries.section('services').level('<= 2') %}
                {# % set pageItems = craft.entries.level('<= 2') %# }

                {# Output the sub menu #}
                
                    Home
                    {% set entry = craft.entries.slug('about').first %}
                    {{ entry.title }}

                    {% nav page in pageItems %}
                    
                        
                            {% if page.navigationTitle %}{{ page.navigationTitle|nl2br }}{% else %}{{ page.title }}{% endif %}
                        
                        {% ifchildren %}
                        
                            
                                {% children %}
                            
                        
                        {% endifchildren %}
                    
                    {% endnav %}
                
                
                    {% set entry = craft.entries.slug('testimonials').first %}
                        {{ entry.title }}
                    {% set entry = craft.entries.slug('contact').first %}
                        {{ entry.title }}
                    {% set entry = craft.entries.slug('get-a-quote').first %}
                        {{ entry.title }}
                
            
        
    

footer.html:
    
        
            
                
            
            
                
                    linkedin
                    facebook
                
                {{ siteName }}
                {{ companyInfo.address }}
                {{ companyInfo.phoneNumber }}
                
                    Open: Mon.-Fri. 8:30am-4pm Closed Daily from 12:00pm-1:00pm
                
            
        
    

head.html:



    
    

    {!-- META TITLE --}
    
        {% if entry.metaTitle != '' %}
            {{entry.metaTitle}}
        {% else %}
            My Site
        {% endif %}
    

    {!-- META DESCRPTION --}
    {% if entry.metaDescription != '' %}
    
    {% endif %}

    {!-- META KEYWORDS --}
    {% if entry.metaKeywords != '' %}
        
    {% endif %}

    
    
    

    
    {% block css_wufoo %}{% endblock %}
    {% block css_fancybox %}{% endblock %}

**Tags:** templating, error-message, 404-page, error-templates


---

## 1 answers

### Answer by username_1 on 2014-12-08. Score: 1 | Accepted answer

The error indicates you're trying to use a Twig filter that doesn't exist in your 404 template at line 4.
Maybe you've got a plugin that added it's own filter, but you don't have the plugin installed or enabled?
Update:
Based on the follow up comments, the error message is very misleading and not sure where it is coming from.  The 404 template doesn't have an entry variable defined, so the solution is to wrap any references to it in:
{% if entry is defined %}
    {{ entry.metaTitle }}
{% endif %}

> **Comments:**
> **username_0**: Thanks for the help, Brad. I think it's the `entry` tags causing issue. Any idea how to fix so that I can use those tags in head? I added code to original post for your reference.  
> **username_1**: Is that code from your `_layout.html` template?  
> **username_0**: Ya...I'm embedding the head in the `_layout.html`. Added to original post as well.  
> **username_1**: Might as well post global/head, global/header and global/footer, too. :)  
> **username_0**: Updated original post.  
> **username_1**: If you comment out the calls to `entry.metaTitle`, `entry.metaDescription` and `entry.metaKeywords` in `head.html` does the error go away?  
> **username_0**: Yes, when I remove that block from head it works.  
> **username_1**: Seems like a misleading error message, then. Try wrapping those calls in `{% if entry is defined %}{% endif %}` blocks.  
> **username_0**: Need to modify the meta stuff a bit, but it works! Appreciate the help.  
> **username_1**: Really weird... updated my answer in case anyone else runs across this.  

---

