# Looks like I have finally worked out how to re-add the webmention 'comment_type' to replies meaning I won't have to edit them in the WordPress database. Just need some more testing to be sure.

# After getting the directory page to display all replies, I thought:

"What if when a comment is received we immediately perform the linkbacks type check and, if true, rewrite the comment_type value back to the comments table in the database?"

How to do this?

WordPress has a 'comment_post' hook and actions added to this fire immediately after a comment is posted.

So, I just needed to hook in a function which checks comments as soon as they are posted and, if they are webmention replies, update their comment_type field in the database.

The below seems to work using the same linkbacks type check and then $wpdb->update to write back to the database:

function wm_comment_type( $comment_ID ) {

  $wmreply = get_comment_meta( $comment_ID, 'semantic_linkbacks_type', true );
  global $wpdb;

  if ( $wmreply == 'reply' ) {  

    $result = $wpdb->update(

        'comment_type' => 'webmention' 

        'comment_ID' => $comment_ID



add_action( 'comment_post', 'wm_comment_type', 100, 1 );
Colin Walker Colin Walker colin@colinwalker.blog