Strange error "Bad link tag `[[~14]]` encountered"


Never encoutered this error before. Nothing special on this website.

Bad link tag [[~14]] encountered

It is on every page. So [[~15, 16, 17, 18]] etc. Maybe it is the code in the menu? Using PdoMenu.

Not sure where to start looking.


Any suggestions?

I get that sometimes from Articles and GetPage. I usually just ignore it.

thanks @bobray!

I’ve installed it but not used it. Now I deleted it but still get the errors.

I can ignore them, but they really clogg my error log.

Do the resources with those IDs exist? If so, it could indicate a problem with permissions, where you’re linking to a resource which the current (possibly anonymous) user doesn’t have access to.

You can prevent the error message by commenting out, or removing, this code at around line 1367 in the core\model\modx\modparser.class.php file.

        'Bad link tag `' . $this->_tag . '` encountered', "",
            ? "resource {$this->modx->resource->id}"
            : ($_SERVER['REQUEST_URI'] ? "uri 
                    {$_SERVER['REQUEST_URI']}" : '')

You’d have to do that again any time you upgrade MODX.

1 Like

Bear in mind this can happen even when the ‘link’ is commented out


Thanks Bob that did the trick.

This topic was automatically closed 2 days after discussion ended and a solution was marked. New replies are no longer allowed. You can open a new topic by clicking the link icon below the original post or solution and selecting “+ New Topic”.