1

Assume that users have the ability to edit their own comments. Or administrators can also do that.

Do comments have revisions like posts and pages? If so, how would you access those revisions?

The "History" link on the admin/comments page does not show any editing/changing/updating of the comment, whether done by the admin or the original commenter.

If no comment history is available, how would I add that capability via a filter?

Added for clarification

In regards to the 2nd question that was looking for a starting place for adding comment history (which might have been better to post as a separate question):

I agree with answer comments that creating comment history looks like a big effort.

On the site, I use a plugin that adds "spam/delete/trash" links next to the 'edit' link that admins see. Each of those choices does the action, as well as removing the comment from view. There was a request for a 'redact' link that would replace the comment text with "[redact]", as the requestor wanted the comment text to be removed, but show as redacted.

Then there was the thought that there might be a reason to 'un-redact' a comment, restoring the original comment content. So was looking for a way to do that similar to post/page revisions.

But agree that adding comment revisions would be a big project. Maybe changing the status of a comment to a new value (not spam/delete, etc) and modifying the comment_list to replace the comment text with 'redact' on display, but not modifying the actual content.

1
  • Note that we have a 1 question per question policy, if you have follow up questions you should ask them separately. Bundling questions can severely reduces the number of answers you get, as well as the quality
    – Tom J Nowell
    Commented Aug 14, 2022 at 17:35

1 Answer 1

2

Do comments have revisions like posts and pages? If so, how would you access those revisions?

No, WordPress only provides revisions for posts.

The "History" link on the admin/comments page does not show any editing/changing/updating of the comment, whether done by the admin or the original commenter.

This is actually added by Akismet and not something WordPress itself provides. It acts as a moderation history of sorts, but only Akismet related actions e.g.

enter image description here

Note that I'd edited the comment pictured, yet that edit was not recorded.

If no comment history is available, how would I add that capability via a filter?

Adding it via a filter would require existing infrastructure that doesn't exist, you would need to build it from scratch, and there is no correct canonical way to do it. In my opinion this would lead to lots of competing alternatives, none of which are more correct than the others. You should ask this as a separate question.

5
  • Thanks ... that's what I thought, but was unsure. How would you go about adding revisions to comments? Commented Aug 12, 2022 at 21:40
  • that would be a lot of work, it warrants a new question, extending my answer to include adding revisions to comments would take days of developer time, and massively extends the scope of your question. It's also not what you asked. You'll also want to provide context for why you want them and how you intend to use them, as well as your expectations for what about revisions it is that you specifically need to do
    – Tom J Nowell
    Commented Aug 13, 2022 at 13:46
  • I understand that it would take a bit of work, but the question included "If no comment history is available, how would I add that capability via a filter?" I'm not looking for a complete answer, but a 'shove in the right direction', or even a list of "here's what to do to add comment revisions". Thanks for your thoughts. Commented Aug 13, 2022 at 18:00
  • this is definitely not something you can do by just adding a filter, it would be a major piece of work. I would note though that there is a 1 question per question policy, bundling questions together significantly reduces the chances of your question getting an answer. You really should ask it as an independent question, I have no plans to extend my answer to include the equivalent of a core feature plugin submission
    – Tom J Nowell
    Commented Aug 14, 2022 at 17:22
  • I did however add a note to my answer, thinking about it further makes me suspect that if you did ask how to do this, there would be multiple conflicting answers and none of them would be more "correct" than the other. Revisions in WP are just posts of type revision, and if you wanted to build revisions for comments there are lots of ways to do that, afterall you're asking "how do I get previous versions as content + timestamp?".You also dodged my questions about context, you might not need comment revisions and save a huge amount of time.
    – Tom J Nowell
    Commented Aug 14, 2022 at 17:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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