• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar

WP SITES

2784

Original Genesis Tutorials & 6000+ Guaranteed Code

Snippets

  • Consultation
  • Full Access
  • Log in

Modify Text Before & After Comment Form

In this tutorial, i’ll provide the PHP code you can use with any theme to change the text displayed before and after your comments form.

By default, WordPress generates comment notes that include text before and comment form allowed tags after your form which you may want to remove or customize.

Here’s the default form :

comment form default

And here’s an example of what you can do simply by adding the code at the end of your child themes functions.php file and customizing the text in the code:

change comment form notes

Here’s the code which i have modified as per the screenshot above:

One benefit of using this code is that it removes the comment form allowed tags. You can also achieve this by installing this plugin.

Its very easy to style because the code includes the comments-notes class which you can paste at the end of your child themes style sheet and add your own declarations.

You can also change the comments-notes class in the PHP code above if you want to style the before and after notes differently.

.comment-notes {
color: blue;
}

The code in this tutorial enables you to easily modify the default text and add a comment form policy, HTML or pretty much anything else.

Other Options

  • Customize Comment Form Place Holder Input Text Fields & Labels
  • Remove Comments From Specific Posts and Different Categories
  • Customize Comment Form Text Area & Label
  • Style Comment Form Submit Button

Pretty basic stuff, what do you think?

Reader Interactions

Comments

  1. Chris says

    September 3, 2013 at 10:48 am

    Great, thank you very much, appreciate!

    Log in to Reply
    • Brad Dalton says

      September 3, 2013 at 10:49 am

      No worries.

      Log in to Reply
  2. AnthonyC says

    September 3, 2013 at 9:31 am

    Brad, thank you so much for posting this! I literally just had this question the other day and was going to make a post on a forum asking how to accomplish this! Instead, I find someone posted a link to a few of your tutorials, and bam – my question already answered here! 🙂

    Mind answering a new question though? Do you have any code that I could add to make commenters’ website links open in a new window? I know it just needs the target=”_blank” code, but I wouldn’t know how to make a custom php to do that…? (I’m using Dynamik Website Builder, and if you have a php option like the above code, I could just easily add it in the custom functions section like I did with this code you gave here!)

    Log in to Reply
    • Brad Dalton says

      September 3, 2013 at 9:49 am

      No worries Anthony

      I’ll email you the link to the code.

      Log in to Reply
      • Chris says

        September 3, 2013 at 10:33 am

        Hi Brad, I would be interested, too, in this code. Thanks.

        Log in to Reply
        • Brad Dalton says

          September 3, 2013 at 10:39 am

          Just published a new post with the code Chris.

          Log in to Reply
  3. Chris says

    September 2, 2013 at 8:36 am

    Great tipps, thanks a lot, exactly what I need right now!

    Log in to Reply
    • Brad Dalton says

      September 2, 2013 at 8:37 am

      No worries Chris

      Log in to Reply
  4. Derek says

    September 2, 2013 at 2:51 am

    Brad, excellent piece of code. I got this added and works perfectly.

    Log in to Reply
    • Brad Dalton says

      September 2, 2013 at 3:06 am

      Thanks Derek.

      Also works with any theme as it uses the WordPress filter hooks rather than any theme specific hooks.

      Log in to Reply

Leave a Reply Cancel reply

You must be logged in to post a comment.

Primary Sidebar

Code written by Brad Dalton specialist for Genesis, WooCommerce & WordPress theme customization. Read More…

Advertise · WPEngine · Genesis · Log in

  • Access Problems
  • Account Details
  • Consulting
  • Tags
 

Loading Comments...
 

You must be logged in to post a comment.