[Resolved] Disable links in WordPress Comments (except those from registered users)

Home Forums Support Disable links in WordPress Comments (except those from registered users)

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #1032231
    Hilton

    Hi,

    We recently decided to disable all links that were active within the comments, but we want the links posted by our registered users (contributor, editor, author) to remain active.

    We added this function to functions.php but it has disabled all links in comments, including those posted by our registered users.

    add_filter (‘pre_comment_content’, ‘wp_specialchars’); // disable HTML in comments
    remove_filter (‘comment_text’, ‘make_clickable’, 9); // autolinks in comments

    How can we disable all links, leaving clickable only the links of our users (contributor, editor, author)?

    Thanks

    #1032251
    Leo
    Staff
    Customer Support

    Hi there,

    I believe this would require a custom solution and the theme doesn’t handle this at all as the comment system is handled by WordPress itself

    You’d need to check with their support to see if they have any suggestions.

    If not then might be helpful to post on a general forum like https://stackoverflow.com/

    #1032274
    Hilton

    Ok Leo, thanks

    #1032277
    Leo
    Staff
    Customer Support
Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.