Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter DrLightman

    (@drlightman)

    More generally, the <a> HTML element never expects the “alt” attribute, so you can remove it plugin-wide.

    https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a

    I see it could be a problem since you hard-code the post’s contents with the additional links into a separate table, so I wouldn’t know how to fix the faulty links on posts that aren’t being manually updated via the editor.

    Hello @drlightman,

    search engines read any texts, including those written in “alt” and “title” attributes. It is not a bug, it is feature of our plugin.

    The presence of this tag in the links does not in any way harm your site and links while it remains still workable.

    We will add an option to switch on/off alt, title in the next plugin version.

    Thread Starter DrLightman

    (@drlightman)

    It wouldn’t bother me, but AMP complains about that tag in AMP pages therefore they don’t validate as valid AMP code and that’s bad for Google.

    You can see it here by yourself:

    https://validator.ampproject.org/

    By entering this test code:

    <!--
         This is the minimum valid AMP HTML document. Type away
         here and the AMP Validator will re-check your document on the fly.
    -->
    <!doctype html>
    <html ?>
    <head>
      <meta charset="utf-8">
      <link rel="canonical" href="self.html" />
      <meta name="viewport" content="width=device-width,minimum-scale=1">
      <style amp-boilerplate>body{-webkit-animation:-amp-start 8s steps(1,end) 0s 1 normal both;-moz-animation:-amp-start 8s steps(1,end) 0s 1 normal both;-ms-animation:-amp-start 8s steps(1,end) 0s 1 normal both;animation:-amp-start 8s steps(1,end) 0s 1 normal both}@-webkit-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@-moz-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@-ms-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@-o-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}</style><noscript><style amp-boilerplate>body{-webkit-animation:none;-moz-animation:none;-ms-animation:none;animation:none}</style></noscript>
      <script async src="https://cdn.ampproject.org/v0.js"></script>
    </head>
    <body>Hello, AMP world.</body>
      <a href="https://example.org" alt="some alt text">hello</a>
    </html>

    More on AMP and Google:
    https://support.google.com/webmasters/answer/6340290?hl=en

    For example if a site has an article at this url:
    https://site.com/article/
    if the site supports AMP, it will deliver the AMP version of that article at the url:
    https://site.com/article/amp/

    Thread Starter DrLightman

    (@drlightman)

    I made a mistake in the code above with the closing body tag, this is the correct test code to use:

    <!--
         This is the minimum valid AMP HTML document. Type away
         here and the AMP Validator will re-check your document on the fly.
    -->
    <!doctype html>
    <html ?>
    <head>
      <meta charset="utf-8">
      <link rel="canonical" href="self.html" />
      <meta name="viewport" content="width=device-width,minimum-scale=1">
      <style amp-boilerplate>body{-webkit-animation:-amp-start 8s steps(1,end) 0s 1 normal both;-moz-animation:-amp-start 8s steps(1,end) 0s 1 normal both;-ms-animation:-amp-start 8s steps(1,end) 0s 1 normal both;animation:-amp-start 8s steps(1,end) 0s 1 normal both}@-webkit-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@-moz-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@-ms-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@-o-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}</style><noscript><style amp-boilerplate>body{-webkit-animation:none;-moz-animation:none;-ms-animation:none;animation:none}</style></noscript>
      <script async src="https://cdn.ampproject.org/v0.js"></script>
    </head>
    <body>Hello, AMP world.
      <a href="https://example.org" alt="some alt text">hello</a>
    </body></html>
Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘AMP issues with “alt” attributes’ is closed to new replies.