How To Leverage WordPress Comments Using Google Q&A Schema

It struck me as Google updated it’s guidelines on using the Q&A Markup, that it’s goal was to help Google surface user answers.

Since I had spent the better part of the previous 30 minutes fighting to clear my spammy, useless comments I thought.

What if I could use my bloody useless “comments” in WordPress for something more helpful for me and my users?

Jeremy Rivera Being Brilliant
How awesome would it be to win this type of rich snippet?

Using Comments For Q&A

So that’s why I’m writing this post, I’m gonna muck about with my WordPress Comment Theme settings to see if I can make some magic happen.

(orrrr break some stuff. But hey, if comments don’t show up then I just will miss out on the lastest Russian spam attempt to get me infected with malware or link to their camgirl site.)

So I added Q& A markup to the following header, and will try to make WordPress produce comments with proper, validated answers.

(Hint: If you know WordPress and have some idea IF I can do this…then ANSWER in the “comment ” uh..thingy

Ensuring Answers are long enough AKA: How To Add Code To WordPress Theme and enforce a minimum or maximum number of characters for a comment

While in my quest to figure out how to make WordPress comments be more than a hot pile of week old garbage, I thought found a post with a useful bit of code to add the Theme Functions file that controls the desired length of comments.

Why would I want to change the character limit in my WordPress comments?

  • Comments of “hi” or “Nice post” suck. Seriously. Why? Why are you the way that you are?
  • Comments over 500+ words are 99.999999% spam. Seriously, no one writes THAT much in a comment.
  • Real, non-spammy comments will usually be more than 60 characters-ish and less than 5000 characters.
  • This will kill quite a bit of your comment spam submissions from getting through.

So here ya go, the code you need to add to the WordPress Theme Functions file:

add_filter( 'preprocess_comment', 'wpb_preprocess_comment');functionwpb_preprocess_comment($comment) {if( strlen( $comment['comment_content'] ) > 5000 ) {wp_die('Comment is too long. Please keep your comment under 5000 characters.');}if( strlen( $comment['comment_content'] ) < 60 ) {wp_die('Comment is too short. Please use at least 60 characters.');}return$comment;}

How To Change WordPress Comment Title from “Leave a Reply”

It’s surprisingly difficult to find easy to digest, usable advice on how to edit your WordPress comments! But I finally found a good article.

Here's what WordPresss default comment form looks like
Here’s what WordPress’s default comment form will look like by using the “comment_form” call function. You have to add “arguments” to edit this default view.
  • Go to “Appearance” in your WordPress navigation
  • Click “Editor”
  • Choose “Comments” which is the home of your comments.php file
  • Add an “array” that will summon up your custom text
  • Save your theme file
  • **To be extra safe when I edit my theme file, I keep one tab open with the unedited theme code so I can update THAT and overwrite what I messed up!
Here's what the while thing looked like in the blog post I referenced
<?php comment_form(array('title_reply'=>'Got Something To Say:')); ?>

Mine actually looks like:

<?php
endif;
comment_form(array('title_reply'=>'Schema QA Answers Go Here:'));
?>

Can I Use WordPress Comment Plugin With Q& A Markup To Win Rich Snippets?

One Answer to “How To Leverage WordPress Comments Using Google Q&A Schema”

  1. I think that you can edit the WordPress Comment field to apply Q&A schema, but it’s gonna be a pain in the ass to figure out how to do it without blowing up your theme. Good luck sorting through those blog posts for editing WordPress comments, they’re HOT GARBAGE too!

Schema QA Answers Go Here:

Your email address will not be published. Required fields are marked *