How can I remove the username link which is displayed in the comment submission form?

  1. Simple solution is to use CSS. Just add a css rule to your theme's stylesheet.

    #some .rule {display: none;}
  2. Alternatively you can use hook_form_alter to modify the form and remove the link or change it to something else.

    How to do it depends on your Drupal verion, see the API docs for reference or see altering form with hook_form_FORM_ID_Alter for usage on hook_form_FORM_ID_alter which is a specialized version of hook_form_alter.

  • as i am newbie could you please explain how to resolve it... thanks
    – Fero
    Jun 27 '11 at 6:22

Edit the content type (in Drupal 7 this is under Structure -> Content types), and choose "Anonymous posters may not enter their contact information".

  • Thanks for the reply dylan... But i need to remove the link which leads to profile page when we click on the name of the registered user in comment submission form...
    – Fero
    Jun 27 '11 at 4:28
  • Do you want to remove the name entirely, or change it to plain text? What version of Drupal are you using?
    – Dylan Tack
    Jun 27 '11 at 5:17
  • I need to change it in to plain text... D6 i am using
    – Fero
    Jun 27 '11 at 6:17

I would try doing this in the comments.css stylesheet. That was the easiest way for me. In the Zen theme the style was in comments.css

.comment .submitted /* The "posted by" information */ a {
        pointer-events: none;
       cursor: default;

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.