• I was used to insert images in the comments of my blog.

    I now realise (I don’t know since when) that it’s not possible anymore. Any time I add a code like:

    <img src="[image url]" alt="" />

    It’s automatically deleted when I press the “save” button. There are other issues with different HTML tags, like removing some properties (like, for example id=”name”).
    I see that old comments are not “cleaned” but I’m sure that, if I edit them, they’ll get the same treatment.

    Is there a way to solve this problem?

    Thanks.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Moderator t-p

    (@t-p)

    Were you using a plugin to add images in comments?

    Thread Starter Lock

    (@locksoft)

    Honestly I’ve no idea, I don’t think.
    When I edit a comment I’ve always seen this toolbar:

    https://i.postimg.cc/bJLDmjnb/F548-A17-F-0-A95-4-DDA-B37-A-AADCDF6-A41-F1.jpg

    And I think it’s the standard one (or, at least, I’ve always seen it this way).

    But most of the HTML code I can add with the buttons is now stripped away when I save the comment. I can add an hyperlink but not an image.

    Any idea?

    I had a long-ish conversation on this a while back, but I can’t find that thread ??

    As I remember from my tests, by default, it seems only Administrators and Editors (ie users with the unfiltered_html capability) can add images or use the img tag in comments.

    All other logged-in users and guests can only use a handful of HTML tags and attributes (the “properties” you mentioned):

    <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

    All other HTML tags (eg img) and attributes (eg id, class, style, etc) added by these users will be stripped off.

    But that’s not all.

    It seems the capability of the original comment author is checked when a comment is edited, and not that of the person editing the comment.

    So, as an administrator, you should be able to add an image to your own comment anytime — either at the time of creation or later when you edit the comment. But if you, an administrator, do the same for a comment originally created by someone else who is neither an administrator nor editor, the image code will be stripped out.

    This seems to be the default behaviour. Any deviation from this is likely to come from a plugin.

    Thread Starter Lock

    (@locksoft)

    Thanks George, that is very interesting and it’s exactly what’s happening here.
    I was editing a comment from an user that tried without success to add an image inside. ??

    So, I guess, the only way to overcome this issue is to create myself a comment with his data (name, email, etc.)? Or is there any plug-in that can solve the problem, maybe assigning some privileges to an user or a comment?

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Cannot add images to comments anymore’ is closed to new replies.