Support » Plugin: WP Flow Plus » HTML5 Validation invalid: longdesc attribute on img element

  • Resolved Shashank Shekhar


    The plugin is great, but its generating the wrong html/html5 for the imageflow. I am using html5 site with wp 3.5 and wp-imageflow2 plus 1.7.2.
    The w3c validator giving following error:

    “The longdesc attribute on the img element is obsolete. Use a regular a element to link to the description.”

    The current generated wrong html is:
    <img src=”″ longdesc=”” alt=”altvalue” />

    The valid html can be like:
    <img src=”″ title=”” alt=”altvalue” />

    Means we can use title in place of longdesc to make it valid html.
    Please fix it inside the plugin.

Viewing 7 replies - 1 through 7 (of 7 total)
  • Unfortunately it is not as simple as that as the title is used elsewhere. I will look into this issue for the next major release.

    There is no ‘title’ attribute rendered inside img attributes by default, so I hv just changed some code in the plugin and replaced ‘longdesc’ with ‘title’, worked at my place.
    But as you saying may be it used for some purpose, so data-attributes, rel or some other parameter may be used…
    Lets see what u gonna include in next release.. 🙂

    Is your lightbox working?

    Anyways, title is important for accessibility so I would prefer another method.

    HTML5 has made longdesc obsolete and trying to replace it with title tag, is useless as the title tag does not help people with visual disabilities… and that is the purpose of a longdesc.

    To replace longdesc in html5 you should instead use the combination of explicit links, figure captions, and the attribute aria-describedby.

    Thanks for the hint and help Viraladmin, it was knowledgefull, me and plugin author both didn’t know about the best replacement for ‘longdesc’.
    But I don’t think that the author used longdesc earlier keeping the people with visual disabilities in mind. He just made it that time what he liked too, but now its the concern of w3c validation.
    I am waiting for the author to take the right step and make all right!

    Further, just for more help, could you please put some example html code how it can be done with the right attribute without much changing the current code and achieve validation without breaking functionality?

    The most likely candidate is the use of html5 custom data attribute:

    I am in the middle of a project right now so I won’t have a chance to try it out for a while. You could give it a shot by replacing all occurrences of “longdesc” with something like “data-wpif2”

    Version 1.8.0 has now been released and fixes this issue.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘HTML5 Validation invalid: longdesc attribute on img element’ is closed to new replies.