We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 4095
    • 372 Posts
    Hey guys, I noticed some time ago that MODx put keywords in the following syntax
    <meta http-equiv="keywords" content="blah, blah1, blah2">

    Although it’s valid I believe its more standard to use the following syntax
    <META name="keywords" content="blah, blah1, blah2">


    Is there anyway to change it? I’m trying to avoid the following"

    4.1 Validate that http-equiv Keywords tag is NOT used
    In an effort to trick public search engines people have tried to stuff pages with keywords repeatedly trick the search engine into giving a page a false high relevance ranking. This type of "Spam" could cause your page NOT to be indexed in a public search engine. A common searchability error is to use the http-equiv="keywords" to perform keyword stuffing, this check validates that this practice is not used.
      [img]http://www.emanz.ac.nz/assets/images/logo/emanz-icon_16x16.gif[/img] Emergency Management Academy of New Zealand [br] http://www.emanz.ac.nz[br][br]MODx Sandbox Login: sandbox Password: castle [br]
      Admin Sandbox Login: sandbox Password: castle
      • 25663 MODX Staff
      • 12,272 Posts
      Please file a bug report for that, I think it should be changed and agree. Thanks!
        Ryan Thrash, MODX Co-Founder
        Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
        • 4095
        • 372 Posts
          [img]http://www.emanz.ac.nz/assets/images/logo/emanz-icon_16x16.gif[/img] Emergency Management Academy of New Zealand [br] http://www.emanz.ac.nz[br][br]MODx Sandbox Login: sandbox Password: castle [br]
          Admin Sandbox Login: sandbox Password: castle
          • 33114
          • 518 Posts
          Sorry to disturb but... is the case closed or what? I have a 0.9.2 installation and the meta tag is still "http-equiv="keywords".
            http://modx.ru - российская поддержка MODx
            http://newscup.ru - экспериментальный проект
            http://yentsun.com - персональный сайт
            • 22303 MODX Staff
            • 10,725 Posts
            This is fixed in trunk from SVN, but is not yet available in a stable release. It is a very simple change and one you can easily make by searching for "http-equiv" in your manager/document.parser.class.inc.php and editing the instance relating to keywords in the mergeDocumentMETATags() function.
              • 12110
              • 122 Posts
              Hi, this is more a question on positioning the meta-tags output:

              The keywords are put directly after the doctype and before the "title" tag - they should be after "Content-Type" as "no. 4" - second starting row smiley

              I couldn’t find this in manager/inc/document.parser.class.inc.php ... dont’t want to mess around, maybe somebody has a quick tip on that ... Thx!!
                • 3763
                • 155 Posts
                To put the metas after the title tag, you have to edit the same function wink

                Here is mine (a bit edited):
                <?php
                   function mergeDocumentMETATags($template) {
                      if ($this->documentObject['haskeywords'] == 1) {
                         //insert keywords
                         $keywords = implode (", ", $this->getKeywords());
                         $metas = "\t<meta name=\"keywords\" content=\"{$keywords}\" />\n";
                      }
                
                      if ($this->documentObject['hasmetatags'] == 1) {
                         //insert meta tags
                         $tags = $this->getMETATags();
                         foreach ($tags as $n => $col) {
                            $tag = strtolower ($col['tag']);
                            $tagvalue = $col['tagvalue'];
                            $tagstyle = $col['http_equiv'] ? 'http-equiv' : 'name';
                            $metas .= "\t<meta {$tagstyle}=\"{$tag}\" content=\"{$tagvalue}\" />\n";
                         }
                      }
                      $template = preg_replace ("/(<\/title>)/i", "\\1\n".$metas, $template);
                
                      return $template;
                   }
                ?>


                Just replace it with this one and it’s ready, but remove the <?php ?> tags.

                Boby
                  ...my Photo Gallery on Flickr...
                  • 4295
                  • 98 Posts
                  Thanks, Boby. I was searching the forums looking for a way to move the keywords tag below the title tag and your edit worked perfectly. Thanks for posting the solution.
                    • 6726
                    • 7,075 Posts
                    Great fix Boby, could you file this in the bugtracker so that this thing makes it in the next release ?
                      .: COO - Commerce Guys - Community Driven Innovation :.


                      MODx est l&#39;outil id
                      • 25663 MODX Staff
                      • 12,272 Posts
                      I’m adding it to trunk now... no need (for once!).
                        Ryan Thrash, MODX Co-Founder
                        Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me